feat: new

This commit is contained in:
luo
2026-09-16 16:32:08 +08:00
parent 6a1543f9f6
commit 8bd9de15cd
22 changed files with 2502 additions and 33 deletions

View File

@@ -40,7 +40,7 @@
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { authApi } from '@/api/index.js';
import { authApi, assetApi } from '@/api/index.js';
import { useUserStore } from '@/store/index.js';
const POST_BIND_RELOGIN_NOTICE_KEY = 'postBindReloginNotice';
@@ -57,12 +57,29 @@
let timer = null;
let fromLogin = ref(false);
onMounted(() => {
onMounted(async () => {
// 获取页面参数,判断是否从登录页面跳转过来
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const options = currentPage.options;
fromLogin.value = options.fromLogin === 'true';
// 契约变化:账号已有主手机号时,主号 + 验证码有效 → 幂等建联。
// 预填账号已有主手机号,避免存量用户「提示要验证却提交任何号码都被拒」的死锁。
const token = uni.getStorageSync('token');
const identifier = userStore.state.identifier || uni.getStorageSync('identifier') || '';
if (!token || !identifier) return;
try {
const data = await assetApi.getInfo(identifier);
const mainPhone = (data && data.bound_phone) || '';
if (mainPhone) {
bind.phone = mainPhone;
}
} catch (e) {
// 预填失败不阻塞绑定流程,用户仍可手动输入手机号
console.error('预填主手机号失败', e);
}
});
const prepareManualRelogin = () => {