|
|
@@ -146,9 +146,14 @@ class Request {
|
|
|
resolve(response.data)
|
|
|
}
|
|
|
if (statusCode === 200) { // 成功
|
|
|
+
|
|
|
+
|
|
|
if (response.data.code === 1) {
|
|
|
resolve(response.data)
|
|
|
} else {
|
|
|
+
|
|
|
+ let noLogin = ['pages/pay/index','pages/callback/success']
|
|
|
+ let currentPages = getCurrentPages()[0].route
|
|
|
// 返回错误信息
|
|
|
if (response.data.code == 0) {
|
|
|
if (!config.hideError) {
|
|
|
@@ -163,11 +168,15 @@ class Request {
|
|
|
} else if (response.data.code && response.data.code == -1) {
|
|
|
// 无权限或者登录过期
|
|
|
uni.removeStorageSync('token')
|
|
|
- uni.showToast({
|
|
|
- title: '登录过期,正在重新登录...',
|
|
|
- icon: 'none',
|
|
|
- mask: true
|
|
|
- })
|
|
|
+
|
|
|
+ if(noLogin.indexOf(currentPages) == -1){
|
|
|
+ uni.showToast({
|
|
|
+ title: '登录过期,正在重新登录...',
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
getCheckLogin()
|
|
|
uni.reLaunch({
|
|
|
@@ -178,11 +187,14 @@ class Request {
|
|
|
uni.removeStorageSync('token')
|
|
|
uni.removeStorageSync('shopUser')
|
|
|
uni.removeStorageSync('account')
|
|
|
- uni.showToast({
|
|
|
- title: '登录失效,正在重新登录...',
|
|
|
- icon: 'none',
|
|
|
- mask: true
|
|
|
- })
|
|
|
+ if(noLogin.indexOf(currentPages) == -1){
|
|
|
+ uni.showToast({
|
|
|
+ title: '登录失效,正在重新登录...',
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
getCheckLogin()
|
|
|
uni.reLaunch({
|