Handy_Cao 1 년 전
부모
커밋
bafb8b2e76
3개의 변경된 파일4개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 3
      src/packages/pc/App.vue
  2. 1 1
      src/packages/pc/router/dynamicRouter.ts
  3. 2 4
      src/services/websocket/message.ts

+ 1 - 3
src/packages/pc/App.vue

@@ -13,18 +13,16 @@ export default {
 import { useRouter } from 'vue-router'
 import { ElMessageBox, ElNotification } from 'element-plus'
 import { useLogin } from '@/business/login'
-import { i18n } from '@/stores'
 import eventBus from '@/services/bus'
 
 const { userLogout } = useLogin()
 const router = useRouter()
-const { t } = i18n.global 
 
 // 接收用户登出通知
 eventBus.$on('LogoutNotify', (msg) => {
   userLogout(() => {
     if (msg) {
-      ElMessageBox.alert(msg as string, t('user.login.tips4'))
+      ElMessageBox.alert(msg as string, '下线通知')
     }
     router.replace({ name: 'login' })
   })

+ 1 - 1
src/packages/pc/router/dynamicRouter.ts

@@ -1,6 +1,6 @@
 import { RouteRecordRaw } from 'vue-router'
 import { AuthType } from '@/constants/menu'
-import { useMenuStore, i18n } from '@/stores'
+import { useMenuStore } from '@/stores'
 import router from '../router'
 
 export default new (class {

+ 2 - 4
src/services/websocket/message.ts

@@ -1,12 +1,10 @@
 import { timerInterceptor } from '@/utils/timer'
 import { FunCode } from '@/constants/funcode'
-import { useErrorInfoStore, i18n } from '@/stores'
+import { useErrorInfoStore } from '@/stores'
 import eventBus from '@/services/bus'
 import { Package50 } from './package'
 import { decodeProto } from './package/package50/proto'
 
-const { t } = i18n.global
-
 /**
  * 处理 Package50 消息推送
  * @param pkg 
@@ -29,7 +27,7 @@ export async function pushMessage50(pkg: Package50, contentType: 'encrypted' | '
                 errcode = JSON.parse(res).RetCode
             }
             // 用户登出通知
-            eventBus.$emit('LogoutNotify', getErrorInfoByCode(errcode) || t('user.login.tips5'))
+            eventBus.$emit('LogoutNotify', getErrorInfoByCode(errcode) || '账号已登出')
             break
         }
         case FunCode.MoneyChangedNotify: {