This commit is contained in:
2025-11-26 16:56:56 +08:00
parent 08ab9bf017
commit deab83fc81
10 changed files with 1215 additions and 746 deletions

View File

@@ -208,7 +208,12 @@ const i18n = new VueI18n({
});
//使用钩子函数对路由进行权限跳转
router.beforeEach(async (to, from, next) => {
try {
const currentRoute = to; // 获取当前路由路径,例如 "/home"
console.log('currentRoute at line 211:', currentRoute.meta)
if(currentRoute.meta.hideTitle){
}else{
try {
// 尝试请求接口(即使失败也继续后续逻辑)
await Promise.all([
loadJournalList(),
@@ -217,7 +222,9 @@ router.beforeEach(async (to, from, next) => {
} catch (err) {
// 仅打印错误,不阻断路由
}
}
// 无论接口成功/失败,都执行原有跳转逻辑
document.title = `${to.meta.title} | Traditional Medicine Research`;