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
925feb87
Commit
925feb87
authored
Jul 11, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并生产_请重新授权
parent
4569b342
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
47 deletions
+41
-47
wxService.js
src/utils/wxService.js
+41
-47
No files found.
src/utils/wxService.js
View file @
925feb87
...
@@ -47,65 +47,59 @@ class WXService extends Http {
...
@@ -47,65 +47,59 @@ class WXService extends Http {
this
.
setPageLoadStatus
()
this
.
setPageLoadStatus
()
wx
.
hideLoading
()
wx
.
hideLoading
()
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
// if (res.msg && res.msg.indexOf('未登录') > -1) {
// // 判断是否登陆过 登陆过 重新登陆 未登陆 跳转首页
// const baseUserInfo = this.getBaseUserInfo()
// if(!baseUserInfo) {
// wxService.router('/pages/userCenter/userCenter').replace()
// return false
// }
// // 条件限制 getUserInfoLimitCount:重试次数
// if (!this.getUserInfoLimitCount) {
// this.getUserInfoLimitCount = 1
// } else {
// this.getUserInfoLimitCount++
// }
// if (this.getUserInfoLimitCount > 3) {
// wx.showToast({
// title: '登录超出重试次数!',
// icon: 'none'
// })
// wxService.router(`/pages/userCenter/userCenter`).replace()
// return false
// } else {
// // 重新登陆 更新缓存
// this.reLogin()
// }
// setTimeout(()=>{
// const pages = getCurrentPages()
// const perpage = pages[pages.length - 1]
// perpage.onShow()
// },2000)
// }
if
(
res
.
msg
&&
res
.
msg
.
indexOf
(
'未登录'
)
>
-
1
)
{
if
(
res
.
msg
&&
res
.
msg
.
indexOf
(
'未登录'
)
>
-
1
)
{
// 判断是否登陆过 登陆过 重新登陆 未登陆 跳转首页
const
baseUserInfo
=
this
.
getBaseUserInfo
()
if
(
!
baseUserInfo
)
{
wxService
.
router
(
'/pages/userCenter/userCenter'
).
replace
()
return
false
}
// 条件限制 getUserInfoLimitCount:重试次数
if
(
!
this
.
getUserInfoLimitCount
)
{
if
(
!
this
.
getUserInfoLimitCount
)
{
this
.
getUserInfoLimitCount
=
1
this
.
getUserInfoLimitCount
=
1
}
else
{
}
else
{
this
.
getUserInfoLimitCount
++
this
.
getUserInfoLimitCount
++
}
}
console
.
log
(
'count'
,
this
.
getUserInfoLimitCount
)
if
(
this
.
getUserInfoLimitCount
>
3
)
{
if
(
this
.
getUserInfoLimitCount
>
3
)
{
wx
.
showToast
({
wx
.
showToast
({
title
:
'登录超出重试次数!'
,
title
:
'会员系统异常,请联系管理员'
,
icon
:
'none'
icon
:
'none'
,
duration
:
2000
})
})
wxService
.
router
(
`/pages/userCenter/userCenter`
).
replace
()
return
false
}
else
{
}
else
{
// 重新登陆 更新缓存
this
.
reLogin
()
this
.
reLogin
()
}
}
}
else
if
(
res
.
msg
&&
res
.
msg
.
indexOf
(
'请重新授权'
)
>
-
1
)
{
setTimeout
(()
=>
{
wx
.
setStorageSync
(
'reLoginErr'
,
true
)
const
pages
=
getCurrentPages
()
// wxService.router(`/pages/userCenter/userCenter`).replace()
const
perpage
=
pages
[
pages
.
length
-
1
]
console
.
log
(
"授权跳转"
)
perpage
.
onShow
()
wxService
.
router
(
`/pages/userCenter/userCenter`
).
back
()
},
2000
)
}
else
if
(
res
.
state
===
402
)
{
return
this
.
getUserInfo
().
then
(()
=>
{
if
(
!
this
.
getUserInfoLimitCount
)
{
this
.
getUserInfoLimitCount
=
1
}
else
{
this
.
getUserInfoLimitCount
++
}
if
(
this
.
getUserInfoLimitCount
>
3
)
{
wx
.
showToast
({
title
:
'会员系统异常,请联系管理员'
,
icon
:
'none'
})
}
else
{
this
.
request
({
url
,
data
,
header
:
{
'buyer-token'
:
this
.
getToken
()
},
method
,
dataType
,
responseType
,
success
,
fail
,
complete
})
}
})
}
}
})
})
}
}
...
...
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