fix(ui): 修复多个功能模块的验证和数据处理问题
- 在医生工作站退费功能中添加患者选择验证 - 统一药品管理中的仓库类型选择逻辑,移除重复代码 - 修复统计管理页面清空按钮的数据重置问题 - 修正西药管理页面处方打印按钮的功能绑定 - 完善库存报表查询的SQL过滤条件实现 - 更新多个控制器接口参数类型以支持业务流程 - 优化退费列表对话框的数据加载和错误处理
This commit is contained in:
@@ -107,15 +107,32 @@ service.interceptors.request.use(config => {
|
||||
if (code === 401) {
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true;
|
||||
ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
isRelogin.show = false;
|
||||
// 判断是否在登录页面
|
||||
const isLoginPage = window.location.pathname === '/login' || window.location.pathname === '/';
|
||||
|
||||
if (isLoginPage) {
|
||||
// 登录页面直接清理token,不弹窗
|
||||
useUserStore().logOut().then(() => {
|
||||
location.href = '/index';
|
||||
})
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
}
|
||||
isRelogin.show = false;
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
return Promise.reject('登录已过期,请重新登录。')
|
||||
}
|
||||
|
||||
// 其他页面:显示提示后自动跳转
|
||||
ElMessage.warning('登录已过期,正在跳转到登录页面...');
|
||||
useUserStore().logOut().then(() => {
|
||||
isRelogin.show = false;
|
||||
// 跳转到登录页,保留当前路径作为redirect参数
|
||||
const currentPath = window.location.pathname;
|
||||
const redirectUrl = currentPath !== '/login' ? `/login?redirect=${encodeURIComponent(currentPath)}` : '/login';
|
||||
location.href = redirectUrl;
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
location.href = '/login';
|
||||
});
|
||||
}
|
||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
} else if (code === 500) {
|
||||
// 检查是否需要跳过错误提示
|
||||
|
||||
Reference in New Issue
Block a user