退出登录跳到扫码页

This commit is contained in:
kk
2026-07-11 16:49:32 +08:00
parent 4292c0f819
commit a08afd0cfd
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -500,6 +500,7 @@ export default {
uni.clearStorageSync();
uni.showToast({ title: '已退出登录', icon: 'success' });
setTimeout(() => {
uni.setStorageSync('__logout_flag', true);
uni.reLaunch({ url: '/pages/index/scan' });
}, 1000);
},
+6
View File
@@ -67,6 +67,12 @@ export default {
};
},
onLoad(options) {
// 退出登录后跳转过来,清除标记,停留在扫码页
if (uni.getStorageSync('__logout_flag')) {
uni.removeStorageSync('__logout_flag');
return;
}
// 1. 检查 JWT(App.vue 已处理首次跳转,这里兜底)
const token = uni.getStorageSync('token');
if (!token) {