提交
This commit is contained in:
@@ -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`;
|
||||
|
||||
Reference in New Issue
Block a user