wuzhen update
This commit is contained in:
1 parent
1277f1c6aa
commit
66034da0c5
17 files changed
+1691
-39
No files matched your search
@@ -1,5 +1,5 @@
|
||||
// 移动端字典数据获取公共方法 - 适配Vue 2.6.14 + uni-app 2.x
|
||||
import { get } from './request.js';
|
||||
import { request } from './request.js';
|
||||
|
||||
/**
|
||||
* 字典数据缓存管理
|
||||
@@ -76,8 +76,12 @@ const dictCache = {
|
||||
* @returns {Promise} 字典数据Promise
|
||||
*/
|
||||
export const getDicts = (dictType) => {
|
||||
return get(`/system/dict/data/type/${dictType}`, null, {
|
||||
isToken: false, // 字典数据不需要token认证
|
||||
return request({
|
||||
url: `/system/dict/data/type/${dictType}`,
|
||||
method: 'GET',
|
||||
header: {
|
||||
isToken: false // 字典数据不需要token认证
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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, '跳转到登录页');
|
||||
|
||||
@@ -215,6 +215,13 @@
|
||||
"navigationBarBackgroundColor": "#0051d9",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/enrollment/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新生报名登记",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
||||
Reference in new issue
Block a user