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

This commit is contained in:
luo
2026-10-13 16:11:02 +08:00
parent da95a914e3
commit 97dec4dc65
9 changed files with 71 additions and 61 deletions

View File

@@ -47,8 +47,6 @@
import { getPhoneBindingMode } from '@/utils/phone-bind.js';
import { getSessionContext, isCurrentSession } from '@/utils/session-context.js';
const POST_BIND_RELOGIN_NOTICE_KEY = 'postBindReloginNotice';
const userStore = useUserStore();
const initializing = ref(true);
const submitting = ref(false);
@@ -85,12 +83,8 @@
fromLogin.value = options.fromLogin === 'true';
if (userStore.state.customerPhone) bind.phone = userStore.state.customerPhone;
// Mandatory binding ends with a new login. Do not consume the day's
// one-time expiry reminder here merely to prefill a phone input.
if (fromLogin.value) {
initializing.value = false;
return;
}
// Binding keeps the current session. Any one-time expiry reminder from
// this prefill request is retained by the shared receiver for the homepage.
const token = uni.getStorageSync('token');
const identifier = userStore.state.identifier || uni.getStorageSync('identifier') || '';
if (!token || !identifier) {
@@ -114,23 +108,6 @@
}
});
const prepareManualRelogin = () => {
const preservedIdentifier = userStore.state.identifier || uni.getStorageSync('identifier') || '';
userStore.clearUser();
if (preservedIdentifier) {
userStore.setIdentifier(preservedIdentifier);
}
uni.setStorageSync(POST_BIND_RELOGIN_NOTICE_KEY, '1');
// #ifdef H5
if (typeof sessionStorage !== 'undefined') {
sessionStorage.removeItem('assetToken');
}
// #endif
};
const getCode = async () => {
if (cooldown.value > 0 || initializing.value || assetConflict.value || bindingMode.value === 'none') return;
if (!bind.phone) {
@@ -187,8 +164,8 @@
userStore.completePhoneBinding(submittedPhone, mode);
if (fromLogin.value) {
prepareManualRelogin();
uni.reLaunch({ url: '/pages/login/login' });
uni.removeStorageSync('postBindReloginNotice');
uni.reLaunch({ url: '/pages/index/index' });
return;
}