feat: 产品菜单路由权限
This commit is contained in:
47
src/utils/stroage.ts
Normal file
47
src/utils/stroage.ts
Normal file
@ -0,0 +1,47 @@
|
||||
export const glsWithCatch = (key: string) => {
|
||||
try {
|
||||
return localStorage?.getItem(key);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const slsWithCatch = (key: string, value: any) => {
|
||||
try {
|
||||
localStorage?.setItem(key, value);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const rlsWithCatch = (key: string) => {
|
||||
try {
|
||||
localStorage?.removeItem(key);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const gssWithCatch = (key: string) => {
|
||||
try {
|
||||
return sessionStorage?.getItem(key);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const sssWithCatch = (key: string, value: any) => {
|
||||
try {
|
||||
sessionStorage?.setItem(key, value);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const rssWithCatch = (key: string) => {
|
||||
try {
|
||||
sessionStorage?.removeItem(key);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user