|
|
@@ -397,7 +397,7 @@ const loadAnnouncements = async () => {
|
|
|
if (!isPublicKeyInitializing.value && !publicKeyInitialized.value) {
|
|
|
isPublicKeyInitializing.value = true
|
|
|
// 显示系统初始化中的提示
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0) // 不自动隐藏
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0) // 不自动隐藏
|
|
|
}
|
|
|
|
|
|
announcements.value = []
|
|
|
@@ -444,7 +444,7 @@ const loadAnnouncements = async () => {
|
|
|
// 公钥不存在,显示初始化提示
|
|
|
if (!isPublicKeyInitializing.value && !publicKeyInitialized.value) {
|
|
|
isPublicKeyInitializing.value = true
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
}
|
|
|
} else {
|
|
|
// 公钥存在但获取失败,显示错误
|
|
|
@@ -491,8 +491,8 @@ const checkBackendStatus = async () => {
|
|
|
backendAvailable.value = true
|
|
|
backendCheckFailures.value = 0
|
|
|
|
|
|
- // 显示登录卡内的状态横幅(服务正常),并在1分钟后自动隐藏
|
|
|
- showLoginStatus('服务正常', 'success', 60_000)
|
|
|
+ // 服务正常时不显示提示,清除任何现有的错误提示
|
|
|
+ showLoginStatus('', 'info', 0)
|
|
|
|
|
|
if (announcementsLoadFailed.value) {
|
|
|
console.log('检测到公告加载失败记录,尝试重新加载公告...')
|
|
|
@@ -534,9 +534,9 @@ const showLoginStatus = (text: string, type: 'info' | 'success' | 'error' = 'inf
|
|
|
|
|
|
loginStatusBanner.text = text
|
|
|
loginStatusBanner.type = type
|
|
|
- loginStatusBanner.show = true
|
|
|
+ loginStatusBanner.show = text.trim() !== '' // 只有当text不为空时才显示
|
|
|
|
|
|
- if (durationMs > 0) {
|
|
|
+ if (durationMs > 0 && loginStatusBanner.show) {
|
|
|
loginStatusBanner.timer = window.setTimeout(() => {
|
|
|
loginStatusBanner.show = false
|
|
|
loginStatusBanner.timer = null
|
|
|
@@ -639,7 +639,7 @@ const handleLogin = async () => {
|
|
|
const hasStoredKey = await PublicKeyManager.hasStoredKey()
|
|
|
if (!hasStoredKey) {
|
|
|
console.log('Rust后端公钥不存在,无法进行安全登录')
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -669,7 +669,7 @@ const handleLogin = async () => {
|
|
|
|
|
|
// 根据错误类型显示不同提示
|
|
|
if (!(await PublicKeyManager.hasStoredKey())) {
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
} else {
|
|
|
// 映射错误信息为用户友好提示
|
|
|
const errorMsg = (() => {
|
|
|
@@ -700,7 +700,7 @@ const handleRegister = async () => {
|
|
|
const hasStoredKey = await PublicKeyManager.hasStoredKey()
|
|
|
if (!hasStoredKey) {
|
|
|
console.log('Rust后端公钥不存在,无法进行安全注册')
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -729,7 +729,7 @@ const handleRegister = async () => {
|
|
|
|
|
|
// 根据错误类型显示不同提示
|
|
|
if (!(await PublicKeyManager.hasStoredKey())) {
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
} else {
|
|
|
const errText = error && (error.toString ? error.toString() : JSON.stringify(error))
|
|
|
showMessage(errText || '注册失败,请稍后重试', 'error')
|
|
|
@@ -785,7 +785,7 @@ const handleUnbind = async () => {
|
|
|
const hasStoredKey = await PublicKeyManager.hasStoredKey()
|
|
|
if (!hasStoredKey) {
|
|
|
console.log('Rust后端公钥不存在,无法进行安全解绑')
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -812,7 +812,7 @@ const handleUnbind = async () => {
|
|
|
|
|
|
// 根据错误类型显示不同提示
|
|
|
if (!(await PublicKeyManager.hasStoredKey())) {
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
} else {
|
|
|
const errText = error && (error.toString ? error.toString() : JSON.stringify(error))
|
|
|
showMessage(errText || '解绑失败,请稍后重试', 'error')
|
|
|
@@ -832,7 +832,7 @@ const handleRecharge = async () => {
|
|
|
const hasStoredKey = await PublicKeyManager.hasStoredKey()
|
|
|
if (!hasStoredKey) {
|
|
|
console.log('Rust后端公钥不存在,无法进行安全充值')
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -860,7 +860,7 @@ const handleRecharge = async () => {
|
|
|
|
|
|
// 根据错误类型显示不同提示
|
|
|
if (!(await PublicKeyManager.hasStoredKey())) {
|
|
|
- showLoginStatus('系统初始化中,请稍等几分钟...', 'info', 0)
|
|
|
+ showLoginStatus('系统初始化中...', 'info', 0)
|
|
|
} else {
|
|
|
const errText = error && (error.toString ? error.toString() : JSON.stringify(error))
|
|
|
showMessage(errText || '充值失败,请稍后重试', 'error')
|