Browse Source

修复类型错误问题

刘洋 2 years ago
parent
commit
761ee912de
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/plugins/storage.ts

+ 2 - 2
src/plugins/storage.ts

@@ -21,7 +21,7 @@ class StorageTool<T extends StorageType = 'local'> {
     this.keyMap = this.storageType === 'local' ? LOCAL_STORAGE_KEYS : SESSION_STORAGE_KEYS
   }
 
-  get<D = any>(storageKey: StorageKey<T>): D | null {
+  get<D = any>(storageKey: any): D | null {
     const key = this.keyMap[storageKey]
     const value = this.storage.getItem(key)
     try {
@@ -43,7 +43,7 @@ class StorageTool<T extends StorageType = 'local'> {
     }
   }
 
-  set(storageKey: StorageKey<T>, data: unknown, option?: { expires: string | Date }) {
+  set(storageKey: any, data: unknown, option?: { expires: string | Date }) {
     const key = this.keyMap[storageKey]
     let cache: string | Date = ''
     if (option?.expires) {