mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 修改数据加密解密,新增登录校验,新增底部备案号
This commit is contained in:
+17
-1
@@ -18,7 +18,7 @@
|
||||
* @param k 键名
|
||||
* @returns any
|
||||
*/
|
||||
export const getLocalStorage = (k: string) => {
|
||||
export const getLocalStorage = (k: string) => {
|
||||
const item = window.localStorage.getItem(k)
|
||||
try {
|
||||
return item ? JSON.parse(item) : item
|
||||
@@ -27,6 +27,14 @@ export const getLocalStorage = (k: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* * 清除本地会话数据
|
||||
* @param name
|
||||
*/
|
||||
export const clearLocalStorage = (name: string) => {
|
||||
window.localStorage.removeItem(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* * 存储临时会话数据
|
||||
* @param k 键名
|
||||
@@ -52,4 +60,12 @@ export const getSessionStorage: (k: string) => any = (k: string) => {
|
||||
} catch (err) {
|
||||
return item
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* * 清除本地会话数据
|
||||
* @param name
|
||||
*/
|
||||
export const clearSessioStorage = (name: string) => {
|
||||
window.sessionStorage.removeItem(name)
|
||||
}
|
||||
Reference in New Issue
Block a user