代码优化
This commit is contained in:
@@ -52,6 +52,17 @@ const install = (Vue, vm) => {
|
||||
}, 1500)
|
||||
return false;
|
||||
} else if (res.code == 401) {
|
||||
// 获取当前页面实例
|
||||
const pages = getCurrentPages();
|
||||
// 获取当前页面的实例
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面路径
|
||||
const pagePath = currentPage.route
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const isIOS = /iOS/.test(systemInfo.platform);
|
||||
// if ( pagePath == "pages/task/index") {
|
||||
// return;
|
||||
// }
|
||||
// 假设201为token失效,这里跳转登录
|
||||
vm.$u.toast('验证失败,请重新登录');
|
||||
uni.removeStorageSync("token")
|
||||
|
||||
Reference in New Issue
Block a user