refactor: ky
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ import { useMenuStore } from '@/stores/menu'
|
||||
// - Component 不直接呼叫 API,避免狀態散落
|
||||
// - token 單一來源:透過 tokenService 同步 ref + localStorage
|
||||
// - store 負責寫入/清除 token(login/logout)
|
||||
// - axios interceptor 只讀 tokenService
|
||||
// - HTTP hooks 只讀 tokenService
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
const user = ref<User | null>(null)
|
||||
const token = tokenService.token
|
||||
|
||||
Reference in New Issue
Block a user