fix: 修复登录跳转路径和版本号更新

refactor: 移除调试日志和冗余代码
style: 格式化代码和修复条件判断逻辑
feat: 重新启用401错误处理并优化表单重置逻辑
This commit is contained in:
砂糖
2025-11-04 14:27:20 +08:00
parent 196f55961a
commit 9fcbad1f8e
7 changed files with 50 additions and 80 deletions

View File

@@ -14,17 +14,14 @@ export default {
if (this.hasJumped) return;
// 显示加载状态,提升用户感知
uni.showLoading({
title: '验证身份中...',
mask: true // 防止用户重复操作
});
// uni.showLoading({
// title: '验证身份中...',
// mask: true // 防止用户重复操作
// });
// 检查用户角色
this.$store.dispatch('GetInfo')
.then(res => {
uni.hideLoading(); // 关闭加载提示
console.log('获取身份信息内容', res.data, )
// 验证返回数据格式
if (!res || !res.data || !Array.isArray(res.data.roles)) {
throw new Error('用户角色信息格式错误');
@@ -97,31 +94,6 @@ export default {
uni.reLaunch({
url: '/pages/login'
})
// uni.hideLoading(); // 关闭加载提示
// console.error('用户信息获取失败:', err);
// // 区分错误类型,给出更精准提示
// const errorMsg = err.message || '网络异常,请检查网络后重试';
// uni.showToast({
// title: errorMsg,
// icon: 'none',
// duration: 3000
// });
// // 提供重试入口
// setTimeout(() => {
// uni.showModal({
// title: '加载失败',
// content: '是否重新登录?',
// success: (res) => {
// if (res.confirm) {
// uni.reLaunch({
// url: '/pages/login'
// })
// }
// }
// });
// }, 3000);
});
}
}

View File

@@ -122,7 +122,7 @@
loginSuccess(result) {
// 设置用户信息
this.$store.dispatch('GetInfo').then(res => {
this.$tab.reLaunch('/pages/easycode/easycode')
this.$tab.reLaunch('/pages/index')
})
}
}