Commit 26fe3218 authored by xiangzj's avatar xiangzj

登出问题

parent 7875b2fe
......@@ -179,7 +179,7 @@
logOut() {
apiLogOut().then((res) => {
uni.setStorageSync('lifeData', {});
uni.navigateTo({
uni.redirectTo({
url: "/pages/login/login"
})
}).catch(() => {
......
......@@ -94,8 +94,7 @@ class Request {
duration: 2000,
icon: 'none'
})
}
if (response.statusCode == 401) {
}else if (response.statusCode == 401) {
uni.showToast({
title: '登录已失效',
duration: 2000,
......@@ -104,7 +103,7 @@ class Request {
uni.navigateTo({
url: "/pages/login/login"
})
}
}else{
uni.showToast({
title: '服务器异常',
duration: 2000,
......@@ -114,6 +113,7 @@ class Request {
}
}
}
}
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options.url = validate.url(options.url) ? options.url : ((options.baseUrl ? options.baseUrl :
......
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