Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
h5-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yimu
h5-front
Commits
328da2b2
Commit
328da2b2
authored
Mar 25, 2022
by
verestrasz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4aa5bae5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
App.vue
src/App.vue
+9
-2
MFetch.js
src/api/MFetch.js
+3
-2
apiVerify.js
src/api/apiVerify.js
+5
-3
order.js
src/api/apiconfig/order.js
+1
-0
No files found.
src/App.vue
View file @
328da2b2
...
@@ -50,14 +50,21 @@ export default {
...
@@ -50,14 +50,21 @@ export default {
// 拿着code去获取openId
// 拿着code去获取openId
// console.log(window.location)
// console.log(window.location)
// 清除code 防止转发自动添加code
// 清除code 防止转发自动添加code
// window.location.search=
"
"
// window.location.search=
window.location.search+"&isUse=1
"
if
(
!
localStorage
.
getItem
(
'openId'
))
{
if
(
!
localStorage
.
getItem
(
'openId'
))
{
this
.
$api
({
this
.
$api
({
apiName
:
'getWxOpenId'
,
apiName
:
'getWxOpenId'
,
postData
:
{
code
:
this
.
code
},
postData
:
{
code
:
this
.
code
},
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
localStorage
.
setItem
(
'openId'
,
res
)
localStorage
.
setItem
(
'openId'
,
res
)
}
},
error
:
()
=>
{
// console.log(error)
if
(
sysInfo
.
isWechat
)
{
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
local
)}
&response_type=code&scope=snsapi_base&state=1#wechat_redirect`
;
}
this
.
code
=
''
},
})
})
}
}
}
}
...
...
src/api/MFetch.js
View file @
328da2b2
...
@@ -71,7 +71,8 @@ class MFetch {
...
@@ -71,7 +71,8 @@ class MFetch {
requireAuth
=
true
,
requireAuth
=
true
,
isUpload
=
false
,
isUpload
=
false
,
onUploadProgress
,
onUploadProgress
,
header
=
{}
header
=
{},
errorMsg
=
true
}
=
config
}
=
config
if
(
!
type
||
!
this
.
httpMap
[
type
])
{
if
(
!
type
||
!
this
.
httpMap
[
type
])
{
...
@@ -126,7 +127,7 @@ class MFetch {
...
@@ -126,7 +127,7 @@ class MFetch {
}
else
{
}
else
{
let
alertServerErrMsg
=
this
.
alertServerErrMsg
let
alertServerErrMsg
=
this
.
alertServerErrMsg
let
clearAdminInfo
=
this
.
clearAdminInfo
let
clearAdminInfo
=
this
.
clearAdminInfo
return
this
.
verify
({
res
,
success
,
error
,
alertServerErrMsg
,
clearAdminInfo
,
url
})
return
this
.
verify
({
res
,
success
,
error
,
alertServerErrMsg
,
clearAdminInfo
,
url
,
errorMsg
})
}
}
})
})
.
catch
(
e
=>
{
.
catch
(
e
=>
{
...
...
src/api/apiVerify.js
View file @
328da2b2
...
@@ -4,7 +4,7 @@ const SUCCESS_CODE = '00000'
...
@@ -4,7 +4,7 @@ const SUCCESS_CODE = '00000'
const
TOKEN_ERR_CODE
=
''
const
TOKEN_ERR_CODE
=
''
function
apiVerify
({
res
,
success
,
error
,
alertServerErrMsg
,
clearAdminInfo
}){
function
apiVerify
({
res
,
success
,
error
,
alertServerErrMsg
,
clearAdminInfo
,
errorMsg
}){
let
{
code
,
data
,
msg
}
=
res
.
data
let
{
code
,
data
,
msg
}
=
res
.
data
if
(
SUCCESS_CODE
===
code
){
if
(
SUCCESS_CODE
===
code
){
success
(
data
)
success
(
data
)
...
@@ -12,8 +12,10 @@ function apiVerify ({res, success, error, alertServerErrMsg, clearAdminInfo}){
...
@@ -12,8 +12,10 @@ function apiVerify ({res, success, error, alertServerErrMsg, clearAdminInfo}){
}
else
if
(
TOKEN_ERR_CODE
===
code
){
}
else
if
(
TOKEN_ERR_CODE
===
code
){
}
else
{
}
else
{
alertServerErrMsg
(
msg
)
error
&&
error
(
res
.
data
)
error
&&
error
()
if
(
errorMsg
)
{
alertServerErrMsg
(
msg
)
}
}
}
}
}
...
...
src/api/apiconfig/order.js
View file @
328da2b2
...
@@ -19,6 +19,7 @@ export const submitPay = {
...
@@ -19,6 +19,7 @@ export const submitPay = {
// 获取openId
// 获取openId
export
const
getWxOpenId
=
{
export
const
getWxOpenId
=
{
url
:
'/wxpay/without/getOpenId'
,
url
:
'/wxpay/without/getOpenId'
,
errorMsg
:
false
,
dealReqData
:
(
{
code
})
=>
{
dealReqData
:
(
{
code
})
=>
{
return
{
code
}
return
{
code
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment