mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 12:13:46 +08:00
优化版权显示逻辑,允许激活用户更改自定义版权
This commit is contained in:
@@ -280,23 +280,11 @@ const router = createRouter({
|
||||
routes: routes,
|
||||
})
|
||||
|
||||
const active = ref(false)
|
||||
const title = ref('')
|
||||
httpGet("/api/config/license").then(res => {
|
||||
active.value = res.data.de_copy
|
||||
}).catch(() => {})
|
||||
httpGet("/api/config/get?key=system").then(res => {
|
||||
title.value = res.data.title
|
||||
}).catch(()=>{})
|
||||
|
||||
let prevRoute = null
|
||||
// dynamic change the title when router change
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (!active.value) {
|
||||
document.title = `${to.meta.title} | ${process.env.VUE_APP_TITLE}`
|
||||
} else {
|
||||
document.title = `${to.meta.title} | ${title.value}`
|
||||
}
|
||||
document.title = to.meta.title
|
||||
prevRoute = from
|
||||
next()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user