优化版权显示逻辑,允许激活用户更改自定义版权

This commit is contained in:
RockYang
2024-07-15 18:44:14 +08:00
parent 0df700ec18
commit f22c6bf658
14 changed files with 83 additions and 52 deletions

View File

@@ -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()
})