tangning 1 年之前
父节点
当前提交
113385af10
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/router/index.ts

+ 6 - 3
src/router/index.ts

@@ -1,7 +1,10 @@
 import { createRouter, createWebHashHistory, Router } from 'vue-router';
 import { useCookies } from '@vueuse/integrations/useCookies';
-import { useI18n } from 'vue-i18n';
-const { t } = useI18n();
+let current = window.navigator.language || window.navigator.userLanguage || null;
+let mytitle = '用户反馈'
+if (current && !/^zh/.test(current)) {
+  mytitle = 'Feedback';
+}
 import routes from './routes';
 const router: Router = createRouter({
   history: createWebHashHistory(),
@@ -12,7 +15,7 @@ router.beforeEach(async (_to, _from, next) => {
   console.log('_to', _to);
   const wxOpenId = useCookies().get('wxOpenId');
   if (_to.name == 'feedback' || _to.name == 'feedbacksuccess') {
-    document.title = t('feedback.title');
+    document.title = mytitle;
   } else {
     document.title = '四维时代售后';
   }