opt: 抽离 session 验证函数,修正前端路由覆盖 bug

This commit is contained in:
RockYang
2023-06-23 06:31:25 +08:00
parent cba54be913
commit 05bdd81646
7 changed files with 94 additions and 67 deletions

View File

@@ -82,6 +82,7 @@ import {useRouter} from 'vue-router';
import {ArrowDown, Expand, Fold} from "@element-plus/icons-vue";
import {httpGet} from "@/utils/http";
import {ElMessage} from "element-plus";
import {checkAdminSession} from "@/action/session";
const message = ref(5);
const username = ref('极客学长')
@@ -93,7 +94,7 @@ const title = ref('Chat-Plus 控制台')
const logo = ref('/images/logo.png')
// 获取会话信息
httpGet("/api/admin/session").then(() => {
checkAdminSession().then(() => {
// 加载系统配置
httpGet('/api/admin/config/get?key=system').then(res => {
title.value = res.data['admin_title'];