refactor: ky

This commit is contained in:
skytek_xinliang
2026-05-07 11:17:30 +08:00
parent 87fbc1dda8
commit 71683482e1
15 changed files with 146 additions and 360 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import { useMenuStore } from '@/stores/menu'
// - Component 不直接呼叫 API,避免狀態散落
// - token 單一來源:透過 tokenService 同步 ref + localStorage
// - store 負責寫入/清除 tokenlogin/logout
// - axios interceptor 只讀 tokenService
// - HTTP hooks 只讀 tokenService
export const useAuthStore = defineStore('auth', () => {
const user = ref<User | null>(null)
const token = tokenService.token