徐勤民 há 6 meses atrás
pai
commit
dca3069591
3 ficheiros alterados com 5 adições e 5 exclusões
  1. 1 1
      BuildProfile.ets
  2. 1 1
      oh-package.json5
  3. 3 3
      src/main/ets/utils/AppStorageHelper.ets

+ 1 - 1
BuildProfile.ets

@@ -1,7 +1,7 @@
 /**
  * Use these variables when you tailor your ArkTS code. They must be of the const type.
  */
-export const HAR_VERSION = '1.0.1';
+export const HAR_VERSION = '1.0.2';
 export const BUILD_MODE_NAME = 'release';
 export const DEBUG = false;
 export const TARGET_NAME = 'default';

+ 1 - 1
oh-package.json5

@@ -1,6 +1,6 @@
 {
   "name": "@szyx/sdk_base",
-  "version": "1.0.1",
+  "version": "1.0.2",
   "description": "数字医信公司,鸿蒙app开发基础工具。",
   "main": "Index.ets",
   "author": "szyx",

+ 3 - 3
src/main/ets/utils/AppStorageHelper.ets

@@ -7,7 +7,7 @@ export class AppStorageHelper {
    * @param key
    * @param value
    */
-  public static save(key: string, value: string|undefined) {
+  public static save<T>(key: string, value: T|undefined) {
     PersistentStorage.persistProp(key, value)
   }
 
@@ -16,7 +16,7 @@ export class AppStorageHelper {
    * @param key
    * @returns
    */
-  public static get(key: string):string|undefined {
-    return AppStorage.get<string>(key)
+  public static get<T>(key: string):T|undefined {
+    return AppStorage.get<T>(key)
   }
 }