fix: 修改数据加密解密,新增登录校验,新增底部备案号

This commit is contained in:
奔跑的面条
2022-04-13 21:31:18 +08:00
parent b5d420c9bf
commit 9e9410533c
9 changed files with 110 additions and 51 deletions
+17 -1
View File
@@ -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)
}