feat: add SingleRecordMnt component for student record maintenance with search, add, edit, view, and delete functionalities

This commit is contained in:
skytek_xinliang
2026-03-26 11:24:37 +08:00
parent 507afcc99c
commit 069141794e
116 changed files with 15247 additions and 107 deletions
+25
View File
@@ -0,0 +1,25 @@
import { ref } from 'vue'
// Token Service
//
// 設計重點:
// - 單一來源(Single Source of Truth):用 ref 維護 token,並同步 localStorage
// - Store 與 Interceptor 只透過此 service 讀寫 token,避免來源分裂
const storageKey = 'token'
const tokenRef = ref<string | null>(localStorage.getItem(storageKey))
export const tokenService = {
token: tokenRef,
getToken() {
return tokenRef.value
},
setToken(nextToken: string) {
tokenRef.value = nextToken
localStorage.setItem(storageKey, nextToken)
},
clearToken() {
tokenRef.value = null
localStorage.removeItem(storageKey)
}
}