fix: some
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 2m16s

This commit is contained in:
luo
2026-10-14 13:40:55 +08:00
parent 131823ca12
commit f7cb28febf
6 changed files with 262 additions and 20 deletions

View File

@@ -305,8 +305,9 @@
};
const loadAssetInfo = async () => {
const identifier = userStore.state.identifier;
const identifier = String(userStore.state.identifier || uni.getStorageSync('identifier') || '').trim();
if (!identifier) return;
if (userStore.state.identifier !== identifier) userStore.setIdentifier(identifier);
const context = getSessionContext();
loading.value = true;
@@ -401,11 +402,18 @@
};
const handleIndexEntry = async () => {
if (userStore.state.loginPending) return;
const token = uni.getStorageSync('token');
if (!token) {
const identifier = String(userStore.state.identifier || uni.getStorageSync('identifier') || '').trim();
if (!token || !identifier) {
if (token && !identifier) {
userStore.clearUser();
uni.showToast({ title: '缺少资产标识,请重新输入或扫码登录', icon: 'none' });
}
uni.reLaunch({ url: '/pages/login/login' });
return;
}
if (userStore.state.identifier !== identifier) userStore.setIdentifier(identifier);
if (indexEntryChecking.value) return;
indexEntryChecking.value = true;
@@ -1001,7 +1009,11 @@
awaitingHomeReminders.value = true;
notificationFallbackPending = false;
notificationQueued = false;
if (!getSessionContext().token) {
if (userStore.state.loginPending) {
awaitingHomeReminders.value = false;
return;
}
if (!getSessionContext().token || !String(userStore.state.identifier || uni.getStorageSync('identifier') || '').trim()) {
awaitingHomeReminders.value = false;
handleIndexEntry();
return;