feat: 登录接口联调

This commit is contained in:
DEV_DSW
2025-12-23 10:49:04 +08:00
parent 5caa9a5a4b
commit a7ef9ec8ad
10 changed files with 180 additions and 598 deletions

View File

@@ -1,6 +1,6 @@
import router from './router'
import { isPathMatch } from '@utils/validate'
import { getToken } from '@utils/auth'
import { Session } from '@renderer/utils/storage'
// 白名单
const whiteList = ['/login', '/register']
@@ -8,7 +8,7 @@ const whiteList = ['/login', '/register']
const isWhiteList = (path: string) => whiteList.some(pattern => isPathMatch(pattern, path))
router.beforeEach((to: any, _from: any, next: any) => {
if(getToken()) {
if(Session.getToken()) {
// has token
if (to.path === '/login') {
next({path: '/home'})