Commit 26fe3218 authored by xiangzj's avatar xiangzj

登出问题

parent 7875b2fe
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
logOut() { logOut() {
apiLogOut().then((res) => { apiLogOut().then((res) => {
uni.setStorageSync('lifeData', {}); uni.setStorageSync('lifeData', {});
uni.navigateTo({ uni.redirectTo({
url: "/pages/login/login" url: "/pages/login/login"
}) })
}).catch(() => { }).catch(() => {
......
...@@ -94,8 +94,7 @@ class Request { ...@@ -94,8 +94,7 @@ class Request {
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
} }else if (response.statusCode == 401) {
if (response.statusCode == 401) {
uni.showToast({ uni.showToast({
title: '登录已失效', title: '登录已失效',
duration: 2000, duration: 2000,
...@@ -104,13 +103,14 @@ class Request { ...@@ -104,13 +103,14 @@ class Request {
uni.navigateTo({ uni.navigateTo({
url: "/pages/login/login" url: "/pages/login/login"
}) })
}else{
uni.showToast({
title: '服务器异常',
duration: 2000,
icon: 'none'
})
reject(response)
} }
uni.showToast({
title: '服务器异常',
duration: 2000,
icon: 'none'
})
reject(response)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment