Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
8efb97a2
Commit
8efb97a2
authored
Jun 10, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登陆
parent
73af0c8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
49 deletions
+43
-49
authorization-modal.js
src/component/authorization-modal/authorization-modal.js
+1
-0
picNav.js
src/component/picNav/picNav.js
+25
-19
Http.js
src/utils/Http.js
+1
-1
wxService.js
src/utils/wxService.js
+16
-29
No files found.
src/component/authorization-modal/authorization-modal.js
View file @
8efb97a2
...
...
@@ -56,6 +56,7 @@ Component({
const
userInfo
=
res
.
detail
||
{}
if
(
res
.
detail
.
userInfo
)
{
utils
.
getUserInfoByBtn
(
userInfo
).
then
(
(
data
=
{}
)
=>
{
console
.
log
(
'----'
,
data
)
const
{
token
}
=
data
wx
.
setStorageSync
(
'_accreditUserInfo'
,
userInfo
)
wx
.
hideNavigationBarLoading
()
...
...
src/component/picNav/picNav.js
View file @
8efb97a2
...
...
@@ -37,31 +37,37 @@ Component({
},
preview
(
e
)
{
const
{
appid
,
path
}
=
e
.
currentTarget
.
dataset
const
{
memberActivateStatus
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
userInfo
){
// 是当前小程序 直接跳转
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
wxService
.
router
(
`
${
path
}
`
)
}
else
{
// 跳转其他小程序
wx
.
navigateToMiniProgram
({
appId
:
appid
,
path
:
`
${
path
}
`
,
success
:
e
=>
{
console
.
log
(
e
)
},
fail
:
e
=>
{
console
.
log
(
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
if
(
!
memberActivateStatus
){
wxService
.
openCard
()
}
else
{
wxService
.
router
(
`
${
path
}
`
)
}
}
else
{
// 跳转其他小程序
wx
.
navigateToMiniProgram
({
appId
:
appid
,
path
:
`
${
path
}
`
,
success
:
e
=>
{
console
.
log
(
e
)
},
fail
:
e
=>
{
console
.
log
(
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
}
// 是当前小程序 直接跳转
}
else
{
console
.
log
(
'222'
)
this
.
setData
({
isAuthorization
:
true
})
...
...
src/utils/Http.js
View file @
8efb97a2
...
...
@@ -148,7 +148,7 @@ class Http {
content
:
'请求数据超时'
})
}
if
(
error
.
msg
){
if
(
error
.
msg
&&
error
.
msg
!=
'用户未登录'
){
wx
.
showToast
({
title
:
`
${
error
.
msg
}
`
,
icon
:
'none'
...
...
src/utils/wxService.js
View file @
8efb97a2
...
...
@@ -47,38 +47,24 @@ class WXService extends Http {
this
.
setPageLoadStatus
()
wx
.
hideLoading
()
}).
catch
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
.
state
===
401
)
{
// this.openCard()
console
.
log
(
res
)
if
(
res
.
msg
===
'用户未登录'
)
{
var
_this
=
this
wx
.
showModal
({
title
:
'温馨提示'
,
content
:
'登录已过期,请重新登录'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
let
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
_this
.
login
().
then
(
result
=>
{
if
(
result
.
code
){
_this
.
post
(
`/member/minaLogin`
,
{
code
:
result
.
code
,
wechatInfo
:
userInfo
,
brandId
:
2005
,
}).
then
(
data
=>
{
const
{
token
}
=
data
if
(
token
)
{
wx
.
setStorageSync
(
'token'
,
token
)
}
else
{
wx
.
setStorageSync
(
'token'
,
''
)
}
wx
.
setStorageSync
(
'_baseUserInfo'
,
data
)
})
}
})
}
else
if
(
res
.
cancel
)
{
}
let
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
_this
.
login
().
then
(
result
=>
{
if
(
result
.
code
){
_this
.
post
(
`/member/minaLogin`
,
{
code
:
result
.
code
,
wechatInfo
:
userInfo
,
brandId
:
2005
,
}).
then
(
response
=>
{
let
dataResp
=
response
.
data
.
data
wx
.
setStorageSync
(
'token'
,
dataResp
.
token
)
wx
.
setStorageSync
(
'_baseUserInfo'
,
dataResp
)
})
}
})
}
else
if
(
res
.
state
===
402
)
{
return
this
.
getUserInfo
().
then
(()
=>
{
if
(
!
this
.
getUserInfoLimitCount
)
{
...
...
@@ -508,6 +494,7 @@ class WXService extends Http {
if
(
memberActivateStatus
)
{
resolve
(
baseUserInfo
)
}
else
{
console
.
log
(
'开卡'
,
baseUserInfo
)
return
this
.
navigateToMiniProgram
({
biz
:
baseUserInfo
.
biz
,
encrypt_card_id
:
baseUserInfo
.
encryptCardId
,
...
...
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