Handy_Cao 1 yıl önce
ebeveyn
işleme
0d293d1ec0
2 değiştirilmiş dosya ile 6 ekleme ve 4 silme
  1. 3 2
      src/business/common/index.ts
  2. 3 2
      src/packages/tss/App.vue

+ 3 - 2
src/business/common/index.ts

@@ -1,6 +1,7 @@
 import { timerTask } from '@/utils/timer'
 import { tokenCheck } from '@/services/api/account'
 import eventBus from '@/services/bus'
+import { i18n } from '@/stores'
 
 /**
  * 令牌校验
@@ -10,8 +11,8 @@ export async function checkToken() {
         return await tokenCheck()
     } catch (err) {
         // 临时解决方案,有可能出现网络问题导致超时后账号被登出
-        if (err !== '业务超时') {
-            eventBus.$emit('LogoutNotify', '登录失效,请重新登录')
+        if (err !== i18n.global.t('common.tips17')) {
+            eventBus.$emit('LogoutNotify', i18n.global.t('common.tips18'))
         }
         return Promise.reject(err)
     }

+ 3 - 2
src/packages/tss/App.vue

@@ -10,6 +10,7 @@ import { dialog } from '@/utils/vant'
 import { useLogin } from '@/business/login'
 import eventBus from '@/services/bus'
 import Notify from '@mobile/components/base/notify/index.vue'
+import { i18n } from '@/stores'
 
 const { userLogout } = useLogin()
 const { backHome } = useNavigation()
@@ -26,7 +27,7 @@ eventBus.$on('LogoutNotify', (msg) => {
     if (msg) {
       dialog({
         message: msg as string,
-        confirmButtonText: '确定'
+        confirmButtonText: i18n.global.t('operation.confirm')
       }).then(() => {
         backHome()
       })
@@ -47,7 +48,7 @@ eventBus.$on('RiskToWebNtf', (msg, type) => {
     dialog({
       title: res.title,
       message: res.content,
-      confirmButtonText: '确定'
+      confirmButtonText: i18n.global.t('operation.confirm')
     })
   }
 })