wuzhen update
This commit is contained in:
1 parent
1277f1c6aa
commit
66034da0c5
17 files changed
+1691
-39
No files matched your search
@@ -34,6 +34,17 @@ function getToken() {
|
||||
function handleUnauthorized(message = '登录已失效,请重新登录') {
|
||||
console.log('🔒 处理401未授权响应:', message);
|
||||
|
||||
// 获取当前页面路径
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = '/' + currentPage.route;
|
||||
|
||||
// 如果是新生报名页面,不跳转到登录页,只是静默处理
|
||||
if (currentPath === '/pages/enrollment/index') {
|
||||
console.log('📋 新生报名页面401错误,使用兜底数据,不跳转登录页');
|
||||
return;
|
||||
}
|
||||
|
||||
// 清除登录信息
|
||||
try {
|
||||
uni.removeStorageSync('access_token');
|
||||
@@ -53,11 +64,6 @@ function handleUnauthorized(message = '登录已失效,请重新登录') {
|
||||
|
||||
// 延迟跳转,确保Toast显示
|
||||
setTimeout(() => {
|
||||
// 获取当前页面路径
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = '/' + currentPage.route;
|
||||
|
||||
// 如果当前不是登录页,则跳转到登录页
|
||||
if (currentPath !== '/pages/login/index') {
|
||||
console.log('🔄 从', currentPath, '跳转到登录页');
|
||||
|
||||
Reference in new issue
Block a user