Initial commit: Copilot Toolbox template project

This commit is contained in:
Evan
2026-01-09 10:49:51 +08:00
commit 0b4b053566
31 changed files with 12085 additions and 0 deletions

43
src/utils/cacheUtil.ts Normal file
View File

@@ -0,0 +1,43 @@
export function cacheGet(key: string): string {
return localStorage.getItem(key) || ''
}
export function cacheSet(key: string, value: string) {
localStorage.setItem(key, value)
}
export function cacheClear(key: string) {
localStorage.removeItem(key)
}
export function cacheDeleteAll() {
localStorage.clear()
}
export interface UserInfo {
id?: string
avatar?: string
gender?: string
nickName?: string
username?: string
position?: string
deptName?: string
mobile?: string
bizMail?: string
email?: string
corpName?: string
effectivePoint?: string
totalPoint?: string
}
export function getUserInfo(): UserInfo | null {
const res = localStorage.getItem('userInfo')
if (!res) {
return null
} else {
return JSON.parse(res)
}
}
export function getToken() {
return localStorage.getItem('token')
}