修复login.uvue中CONSUMER_TEST_ACCOUNT未定义错误

This commit is contained in:
2026-06-11 08:52:23 +08:00
parent da8a5eb5da
commit 389c22c627

View File

@@ -183,8 +183,8 @@ const DELIVERY_TEST_ACCOUNT = 'homecare_worker@test.com'
const DELIVERY_TEST_PASSWORD = 'Homecare123!' const DELIVERY_TEST_PASSWORD = 'Homecare123!'
// ✅ account/password 直接以常量作初始值,上线/刷新立即生效,不再依赖 onMounted 延迟赋值 // ✅ account/password 直接以常量作初始值,上线/刷新立即生效,不再依赖 onMounted 延迟赋值
const account = ref<string>(CONSUMER_TEST_ACCOUNT) const account = ref<string>(TEST_ACCOUNT)
const password = ref<string>(CONSUMER_TEST_PASSWORD) const password = ref<string>(TEST_PASSWORD)
const captcha = ref<string>('') const captcha = ref<string>('')
const isPasswordVisible = ref<boolean>(false) const isPasswordVisible = ref<boolean>(false)
@@ -379,7 +379,7 @@ onMounted(() => {
console.log('[Login] ▶ onMounted 开始') console.log('[Login] ▶ onMounted 开始')
console.log('[Login] 📝 form 初始值:', { console.log('[Login] 📝 form 初始值:', {
account: account.value, account: account.value,
password: account.value === CONSUMER_TEST_ACCOUNT ? '(CONSUMER_TEST_PASSWORD 默认)' : '(ref 已被其他逻辑覆盖)' password: account.value === TEST_ACCOUNT ? '(TEST_PASSWORD 默认)' : '(ref 已被其他逻辑覆盖)'
}) })
// 检查是否存在旧版本 loginn.uvue 遗留的 rememberEmail 缓存 // 检查是否存在旧版本 loginn.uvue 遗留的 rememberEmail 缓存
@@ -401,7 +401,7 @@ onMounted(() => {
console.log('[Login] 📝 onMounted 完成,最终 form 値:', { console.log('[Login] 📝 onMounted 完成,最终 form 値:', {
account: account.value, account: account.value,
isDefault: account.value === CONSUMER_TEST_ACCOUNT isDefault: account.value === TEST_ACCOUNT
}) })
if (isDeliveryMode()) { if (isDeliveryMode()) {