|
@@ -1,10 +1,8 @@
|
|
|
import { createRouter, createWebHashHistory, Router } from 'vue-router';
|
|
|
import { useCookies } from '@vueuse/integrations/useCookies';
|
|
|
-const current = window.navigator.language || window.navigator.userLanguage || null;
|
|
|
-let mytitle = '产品建议';
|
|
|
-if (current && !/^zh/.test(current)) {
|
|
|
- mytitle = 'Feedback';
|
|
|
-}
|
|
|
+// import { useI18n } from 'vue-i18n';
|
|
|
+// const { locale } = useI18n();
|
|
|
+
|
|
|
import routes from './routes';
|
|
|
const router: Router = createRouter({
|
|
|
history: createWebHashHistory(),
|
|
@@ -15,6 +13,12 @@ router.beforeEach(async (_to, _from, next) => {
|
|
|
console.log('_to', _to);
|
|
|
const wxOpenId = useCookies().get('wxOpenId');
|
|
|
if (_to.name == 'feedback' || _to.name == 'feedbacksuccess') {
|
|
|
+ const current = window.navigator.language || window.navigator.userLanguage || localStorage.getItem('lang') || null;
|
|
|
+ let mytitle = '产品建议';
|
|
|
+ if (current && !/^zh/.test(current) || _to.query.lang == 'en') {
|
|
|
+
|
|
|
+ mytitle = 'Feedback';
|
|
|
+ }
|
|
|
document.title = mytitle;
|
|
|
} else {
|
|
|
document.title = '四维时代售后';
|