mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 04:03:42 +08:00
opt: 抽离 session 验证函数,修正前端路由覆盖 bug
This commit is contained in:
@@ -218,6 +218,7 @@ import {useRouter} from "vue-router";
|
||||
import Clipboard from "clipboard";
|
||||
import ConfigDialog from "@/components/ConfigDialog.vue";
|
||||
import PasswordDialog from "@/components/PasswordDialog.vue";
|
||||
import {checkSession} from "@/action/session";
|
||||
|
||||
const title = ref('ChatGPT-智能助手');
|
||||
const logo = 'images/logo.png';
|
||||
@@ -278,16 +279,6 @@ onMounted(() => {
|
||||
})
|
||||
});
|
||||
|
||||
const checkSession = function () {
|
||||
return new Promise((resolve, reject) => {
|
||||
httpGet('/api/user/session').then(res => {
|
||||
resolve(res)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 加载会话
|
||||
const loadChats = function () {
|
||||
httpGet("/api/chat/list?user_id=" + user.value.id).then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user