fix 80650

This commit is contained in:
赵霄
2024-01-15 10:36:13 +08:00
parent abe8230a96
commit 83dcd43936
3 changed files with 27 additions and 4 deletions
+13
View File
@@ -6303,6 +6303,14 @@
}
}
},
"dingtalk-jsapi": {
"version": "3.0.29",
"resolved": "https://registry.npmmirror.com/dingtalk-jsapi/-/dingtalk-jsapi-3.0.29.tgz",
"integrity": "sha512-EWIvppWaLruMggjP85KRpM5TIDSfDkSgS4XOljD0Wf8A26wRxZw3oZIxKFaXiusSJuZsIJakj5FM178hpYi2SA==",
"requires": {
"promise-polyfill": "^7.1.0"
}
},
"dir-glob": {
"version": "2.2.2",
"resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-2.2.2.tgz",
@@ -12572,6 +12580,11 @@
"integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==",
"dev": true
},
"promise-polyfill": {
"version": "7.1.2",
"resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.2.tgz",
"integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ=="
},
"proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
+1
View File
@@ -11,6 +11,7 @@
"ant-design-vue": "1.7.2",
"axios": "^0.21.1",
"core-js": "^3.8.3",
"dingtalk-jsapi": "^3.0.29",
"js-base64": "^3.6.0",
"jsencrypt": "^3.0.0-rc.1",
"md5": "^2.2.1",
+13 -4
View File
@@ -23,6 +23,7 @@ import { Locale } from 'vant'
import zhCN from 'vant/es/locale/lang/zh-CN'
import enUS from 'vant/es/locale/lang/en-US'
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'
import * as dd from 'dingtalk-jsapi' // 解决document.title
const ZH = 'zh-CN'
const EN = 'en-US'
@@ -41,10 +42,6 @@ export default {
Locale.use('zh-CN', zhCN)
this.$i18n.locale = ZH
},
mounted () {
// 修改顶部标题
document.title = this.pageTitle
},
computed: {
// 是否中文
isChinese () {
@@ -74,6 +71,11 @@ export default {
return !!this.$route.meta.isWhiteNavBar
}
},
watch: {
pageTitle (val) {
this.changeTitle(val)
}
},
methods: {
// 返回上一层
handleBack () {
@@ -92,6 +94,13 @@ export default {
Locale.use(targetLang, vantLang)
// 更新i18n语言
this.$i18n.locale = targetLang
},
changeTitle (title) {
if (window.navigator.userAgent.includes('DingTalk')) {
dd.biz.navigation.setTitle({ title })
} else {
document.title = title
}
}
}
}