123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import Cookies from 'js-cookie';
- export const Local = {
-
- set(key: string, val: any) {
- window.localStorage.setItem(key, JSON.stringify(val));
- },
-
- get(key: string) {
- let json = <string>window.localStorage.getItem(key);
- return JSON.parse(json);
- },
-
- remove(key: string) {
- window.localStorage.removeItem(key);
- },
-
- clear() {
- window.localStorage.clear();
- },
- };
- export const Session = {
-
- set(key: string, val: any) {
-
- window.sessionStorage.setItem(key, JSON.stringify(val));
- },
-
- get(key: string) {
-
- let json = <string>window.sessionStorage.getItem(key);
- return JSON.parse(json);
- },
-
- remove(key: string) {
-
- window.sessionStorage.removeItem(key);
- },
-
- clear() {
-
- window.sessionStorage.clear();
- },
- };
|