LiaoYanZhou 1 年之前
父節點
當前提交
a5fb22b116
共有 100 個文件被更改,包括 1505 次插入0 次删除
  1. 12 0
      .gitignore
  2. 10 0
      AppScope/app.json5
  3. 8 0
      AppScope/resources/base/element/string.json
  4. 二進制
      AppScope/resources/base/media/background.png
  5. 二進制
      AppScope/resources/base/media/foreground.png
  6. 7 0
      AppScope/resources/base/media/layered_image.json
  7. 70 0
      build-profile.json5
  8. 32 0
      code-linter.json5
  9. 6 0
      commoms/uicomponents/.gitignore
  10. 1 0
      commoms/uicomponents/Index.ets
  11. 31 0
      commoms/uicomponents/build-profile.json5
  12. 0 0
      commoms/uicomponents/consumer-rules.txt
  13. 6 0
      commoms/uicomponents/hvigorfile.ts
  14. 23 0
      commoms/uicomponents/obfuscation-rules.txt
  15. 9 0
      commoms/uicomponents/oh-package.json5
  16. 11 0
      commoms/uicomponents/src/main/module.json5
  17. 8 0
      commoms/uicomponents/src/main/resources/base/element/float.json
  18. 8 0
      commoms/uicomponents/src/main/resources/base/element/string.json
  19. 35 0
      commoms/uicomponents/src/ohosTest/ets/test/Ability.test.ets
  20. 5 0
      commoms/uicomponents/src/ohosTest/ets/test/List.test.ets
  21. 13 0
      commoms/uicomponents/src/ohosTest/module.json5
  22. 5 0
      commoms/uicomponents/src/test/List.test.ets
  23. 33 0
      commoms/uicomponents/src/test/LocalUnit.test.ets
  24. 6 0
      commoms/utils/.gitignore
  25. 2 0
      commoms/utils/Index.ets
  26. 31 0
      commoms/utils/build-profile.json5
  27. 0 0
      commoms/utils/consumer-rules.txt
  28. 6 0
      commoms/utils/hvigorfile.ts
  29. 23 0
      commoms/utils/obfuscation-rules.txt
  30. 9 0
      commoms/utils/oh-package.json5
  31. 67 0
      commoms/utils/src/main/ets/apis/api.ets
  32. 17 0
      commoms/utils/src/main/ets/apis/auth.ets
  33. 8 0
      commoms/utils/src/main/ets/constants.ets
  34. 4 0
      commoms/utils/src/main/ets/types/User.ets
  35. 17 0
      commoms/utils/src/main/module.json5
  36. 8 0
      commoms/utils/src/main/resources/base/element/float.json
  37. 12 0
      commoms/utils/src/main/resources/base/element/string.json
  38. 35 0
      commoms/utils/src/ohosTest/ets/test/Ability.test.ets
  39. 5 0
      commoms/utils/src/ohosTest/ets/test/List.test.ets
  40. 13 0
      commoms/utils/src/ohosTest/module.json5
  41. 5 0
      commoms/utils/src/test/List.test.ets
  42. 33 0
      commoms/utils/src/test/LocalUnit.test.ets
  43. 6 0
      features/Authentication/.gitignore
  44. 17 0
      features/Authentication/BuildProfile.ets
  45. 1 0
      features/Authentication/Index.ets
  46. 31 0
      features/Authentication/build-profile.json5
  47. 0 0
      features/Authentication/consumer-rules.txt
  48. 6 0
      features/Authentication/hvigorfile.ts
  49. 23 0
      features/Authentication/obfuscation-rules.txt
  50. 19 0
      features/Authentication/oh-package-lock.json5
  51. 11 0
      features/Authentication/oh-package.json5
  52. 29 0
      features/Authentication/src/main/ets/models/NormalLoginModel.ets
  53. 70 0
      features/Authentication/src/main/ets/models/RegisterModel.ets
  54. 21 0
      features/Authentication/src/main/ets/models/ValidCodeLoginModel.ets
  55. 15 0
      features/Authentication/src/main/ets/pages/AuthPage.ets
  56. 11 0
      features/Authentication/src/main/module.json5
  57. 8 0
      features/Authentication/src/main/resources/base/element/float.json
  58. 8 0
      features/Authentication/src/main/resources/base/element/string.json
  59. 35 0
      features/Authentication/src/ohosTest/ets/test/Ability.test.ets
  60. 5 0
      features/Authentication/src/ohosTest/ets/test/List.test.ets
  61. 13 0
      features/Authentication/src/ohosTest/module.json5
  62. 5 0
      features/Authentication/src/test/List.test.ets
  63. 33 0
      features/Authentication/src/test/LocalUnit.test.ets
  64. 6 0
      features/Hello/.gitignore
  65. 17 0
      features/Hello/BuildProfile.ets
  66. 2 0
      features/Hello/Index.ets
  67. 31 0
      features/Hello/build-profile.json5
  68. 0 0
      features/Hello/consumer-rules.txt
  69. 6 0
      features/Hello/hvigorfile.ts
  70. 23 0
      features/Hello/obfuscation-rules.txt
  71. 9 0
      features/Hello/oh-package.json5
  72. 15 0
      features/Hello/src/main/ets/model/Message.ets
  73. 26 0
      features/Hello/src/main/ets/pages/HelloPage.ets
  74. 17 0
      features/Hello/src/main/ets/viewmodel/MessageViewModel.ets
  75. 11 0
      features/Hello/src/main/module.json5
  76. 8 0
      features/Hello/src/main/resources/base/element/float.json
  77. 8 0
      features/Hello/src/main/resources/base/element/string.json
  78. 35 0
      features/Hello/src/ohosTest/ets/test/Ability.test.ets
  79. 5 0
      features/Hello/src/ohosTest/ets/test/List.test.ets
  80. 13 0
      features/Hello/src/ohosTest/module.json5
  81. 5 0
      features/Hello/src/test/List.test.ets
  82. 33 0
      features/Hello/src/test/LocalUnit.test.ets
  83. 6 0
      features/Home/.gitignore
  84. 17 0
      features/Home/BuildProfile.ets
  85. 1 0
      features/Home/Index.ets
  86. 31 0
      features/Home/build-profile.json5
  87. 0 0
      features/Home/consumer-rules.txt
  88. 6 0
      features/Home/hvigorfile.ts
  89. 23 0
      features/Home/obfuscation-rules.txt
  90. 9 0
      features/Home/oh-package.json5
  91. 11 0
      features/Home/src/main/module.json5
  92. 8 0
      features/Home/src/main/resources/base/element/float.json
  93. 8 0
      features/Home/src/main/resources/base/element/string.json
  94. 35 0
      features/Home/src/ohosTest/ets/test/Ability.test.ets
  95. 5 0
      features/Home/src/ohosTest/ets/test/List.test.ets
  96. 13 0
      features/Home/src/ohosTest/module.json5
  97. 5 0
      features/Home/src/test/List.test.ets
  98. 33 0
      features/Home/src/test/LocalUnit.test.ets
  99. 6 0
      features/SignIn/.gitignore
  100. 17 0
      features/SignIn/BuildProfile.ets

+ 12 - 0
.gitignore

@@ -0,0 +1,12 @@
+/node_modules
+/oh_modules
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test
+/.appanalyzer

+ 10 - 0
AppScope/app.json5

@@ -0,0 +1,10 @@
+{
+  "app": {
+    "bundleName": "com.seecoder.testapplication",
+    "vendor": "example",
+    "versionCode": 1000000,
+    "versionName": "1.0.0",
+    "icon": "$media:layered_image",
+    "label": "$string:app_name"
+  }
+}

+ 8 - 0
AppScope/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "app_name",
+      "value": "TestApplication"
+    }
+  ]
+}

二進制
AppScope/resources/base/media/background.png


二進制
AppScope/resources/base/media/foreground.png


+ 7 - 0
AppScope/resources/base/media/layered_image.json

@@ -0,0 +1,7 @@
+{
+  "layered-image":
+  {
+    "background" : "$media:background",
+    "foreground" : "$media:foreground"
+  }
+}

+ 70 - 0
build-profile.json5

@@ -0,0 +1,70 @@
+{
+  "app": {
+    "signingConfigs": [],
+    "products": [
+      {
+        "name": "default",
+        "signingConfig": "default",
+        "targetSdkVersion": "5.1.1(19)",
+        "compatibleSdkVersion": "5.1.1(19)",
+        "runtimeOS": "HarmonyOS",
+        "buildOption": {
+          "strictMode": {
+            "caseSensitiveCheck": true,
+            "useNormalizedOHMUrl": true
+          }
+        }
+      }
+    ],
+    "buildModeSet": [
+      {
+        "name": "debug",
+      },
+      {
+        "name": "release"
+      }
+    ]
+  },
+  "modules": [
+    {
+      "name": "default",
+      "srcPath": "./products/default",
+      "targets": [
+        {
+          "name": "default",
+          "applyToProducts": [
+            "default"
+          ]
+        }
+      ]
+    },
+    {
+      "name": "Hello",
+      "srcPath": "./features/Hello",
+    },
+    {
+      "name": "utils",
+      "srcPath": "./commoms/utils"
+    },
+    {
+      "name": "uicomponents",
+      "srcPath": "./commoms/uicomponents",
+    },
+    {
+      "name": "SignIn",
+      "srcPath": "./features/SignIn",
+    },
+    {
+      "name": "Home",
+      "srcPath": "./features/Home",
+    },
+    {
+      "name": "User",
+      "srcPath": "./features/User",
+    },
+    {
+      "name": "Authentication",
+      "srcPath": "./features/Authentication",
+    }
+  ]
+}

+ 32 - 0
code-linter.json5

@@ -0,0 +1,32 @@
+{
+  "files": [
+    "**/*.ets"
+  ],
+  "ignore": [
+    "**/src/ohosTest/**/*",
+    "**/src/test/**/*",
+    "**/src/mock/**/*",
+    "**/node_modules/**/*",
+    "**/oh_modules/**/*",
+    "**/build/**/*",
+    "**/.preview/**/*"
+  ],
+  "ruleSet": [
+    "plugin:@performance/recommended",
+    "plugin:@typescript-eslint/recommended"
+  ],
+  "rules": {
+    "@security/no-unsafe-aes": "error",
+    "@security/no-unsafe-hash": "error",
+    "@security/no-unsafe-mac": "warn",
+    "@security/no-unsafe-dh": "error",
+    "@security/no-unsafe-dsa": "error",
+    "@security/no-unsafe-ecdsa": "error",
+    "@security/no-unsafe-rsa-encrypt": "error",
+    "@security/no-unsafe-rsa-sign": "error",
+    "@security/no-unsafe-rsa-key": "error",
+    "@security/no-unsafe-dsa-key": "error",
+    "@security/no-unsafe-dh-key": "error",
+    "@security/no-unsafe-3des": "error"
+  }
+}

+ 6 - 0
commoms/uicomponents/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 1 - 0
commoms/uicomponents/Index.ets

@@ -0,0 +1 @@
+

+ 31 - 0
commoms/uicomponents/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": false,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          },
+          "consumerFiles": [
+            "./consumer-rules.txt"
+          ]
+        }
+      },
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest"
+    }
+  ]
+}

+ 0 - 0
commoms/uicomponents/consumer-rules.txt


+ 6 - 0
commoms/uicomponents/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { harTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 23 - 0
commoms/uicomponents/obfuscation-rules.txt

@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation

+ 9 - 0
commoms/uicomponents/oh-package.json5

@@ -0,0 +1,9 @@
+{
+  "name": "uicomponents",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "Index.ets",
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {}
+}

+ 11 - 0
commoms/uicomponents/src/main/module.json5

@@ -0,0 +1,11 @@
+{
+  "module": {
+    "name": "uicomponents",
+    "type": "har",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ]
+  }
+}

+ 8 - 0
commoms/uicomponents/src/main/resources/base/element/float.json

@@ -0,0 +1,8 @@
+{
+  "float": [
+    {
+      "name": "page_text_font_size",
+      "value": "50fp"
+    }
+  ]
+}

+ 8 - 0
commoms/uicomponents/src/main/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "page_show",
+      "value": "page from package"
+    }
+  ]
+}

+ 35 - 0
commoms/uicomponents/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
commoms/uicomponents/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 13 - 0
commoms/uicomponents/src/ohosTest/module.json5

@@ -0,0 +1,13 @@
+{
+  "module": {
+    "name": "uicomponents_test",
+    "type": "feature",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false
+  }
+}

+ 5 - 0
commoms/uicomponents/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
commoms/uicomponents/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 6 - 0
commoms/utils/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 2 - 0
commoms/utils/Index.ets

@@ -0,0 +1,2 @@
+export * from "./src/main/ets/constants"
+export * from "../utils/src/main/ets/apis/auth"

+ 31 - 0
commoms/utils/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": false,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          },
+          "consumerFiles": [
+            "./consumer-rules.txt"
+          ]
+        }
+      },
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest"
+    }
+  ]
+}

+ 0 - 0
commoms/utils/consumer-rules.txt


+ 6 - 0
commoms/utils/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { harTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 23 - 0
commoms/utils/obfuscation-rules.txt

@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation

+ 9 - 0
commoms/utils/oh-package.json5

@@ -0,0 +1,9 @@
+{
+  "name": "utils",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "Index.ets",
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {}
+}

+ 67 - 0
commoms/utils/src/main/ets/apis/api.ets

@@ -0,0 +1,67 @@
+import { rcp } from '@kit.RemoteCommunicationKit';
+import { Constants } from '../constants';
+import { common } from '@kit.AbilityKit';
+import { preferences } from '@kit.ArkData';
+/**
+ * http请求工具类
+ */
+export class Api{
+  // private static router:NavPathStack
+
+  private static getSession(options:rcp.SessionConfiguration,context: common.Context,):rcp.Session{
+    options.baseAddress = Constants.BASE_URL;
+    //添加拦截器
+    options.interceptors = [new RequestTokenInterceptor(context)]
+    return rcp.createSession(options)
+  }
+
+  public static async getRequest(url:string,context: common.Context,options:rcp.SessionConfiguration={}):Promise<rcp.Response>{
+    let session:rcp.Session = Api.getSession(options,context)
+    let res = await session.get(url)
+    session.close()
+    return res
+  }
+
+  public static async postRequest(url:string,context: common.Context,options:rcp.SessionConfiguration={},content?:rcp.RequestContent):Promise<rcp.Response>{
+    let session:rcp.Session = Api.getSession(options,context)
+    let res = await session.post(url,content)
+    session.close()
+    return res
+  }
+
+  public static async deleteRequest(url:string,context: common.Context,options:rcp.SessionConfiguration={}):Promise<rcp.Response>{
+    let session:rcp.Session = Api.getSession(options,context)
+    let res = await session.delete(url)
+    session.close()
+    return res
+  }
+
+  public static async putRequest(url:string,context: common.Context,options:rcp.SessionConfiguration={},content?:rcp.RequestContent):Promise<rcp.Response>{
+    let session:rcp.Session = Api.getSession(options,context)
+    let res = await session.put(url,content)
+    session.close()
+    return res
+  }
+}
+
+/**
+ * 给请求添加token的拦截器
+ */
+class RequestTokenInterceptor implements rcp.Interceptor{
+  private appContext:common.Context
+
+  constructor(context: common.Context) {
+    this.appContext = context;
+  }
+
+  intercept(context: rcp.RequestContext, next: rcp.RequestHandler): Promise<rcp.Response> {
+    let dataPreferences = preferences.getPreferencesSync(this.appContext, {
+      name:'tokenStore'
+    });
+    let token = dataPreferences?.getSync('token',"") as string;
+    context.request.headers = {
+      "Authorization":token
+    }
+    return next.handle(context)
+  }
+}

+ 17 - 0
commoms/utils/src/main/ets/apis/auth.ets

@@ -0,0 +1,17 @@
+import { rcp } from '@kit.RemoteCommunicationKit';
+import { AUTH_PREFIX } from '../constants';
+import { LoginForm } from '../types/User';
+import { Api } from './api';
+import { common } from '@kit.AbilityKit';
+
+export class AuthApis{
+	/**
+	 * 用户登录
+  * @param form 登录表单
+  * @param context 应用上下文
+  * @return
+  */
+  public static login(form:LoginForm,context:common.Context):Promise<rcp.Response>{
+		return Api.postRequest(`${AUTH_PREFIX}/login`,context,{},form)
+	}
+}

+ 8 - 0
commoms/utils/src/main/ets/constants.ets

@@ -0,0 +1,8 @@
+import { common } from "@kit.AbilityKit"
+
+export const AUTH_PREFIX = "/api/auth"
+export class Constants{
+  static readonly  FULL_WITH:string = '100%'
+  static readonly  FULL_HEIGHT:string = '100%'
+  static readonly BASE_URL:string = "https://air-nju.seec.seecoder.cn/"
+}

+ 4 - 0
commoms/utils/src/main/ets/types/User.ets

@@ -0,0 +1,4 @@
+export interface LoginForm{
+  officialNumber: string;
+  password: string;
+}

+ 17 - 0
commoms/utils/src/main/module.json5

@@ -0,0 +1,17 @@
+{
+  "module": {
+    "name": "utils",
+    "type": "har",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ],
+    "requestPermissions": [
+      {
+        "name": "ohos.permission.INTERNET",
+        "reason": "$string:request_reason"
+      }
+    ]
+  }
+}

+ 8 - 0
commoms/utils/src/main/resources/base/element/float.json

@@ -0,0 +1,8 @@
+{
+  "float": [
+    {
+      "name": "page_text_font_size",
+      "value": "50fp"
+    }
+  ]
+}

+ 12 - 0
commoms/utils/src/main/resources/base/element/string.json

@@ -0,0 +1,12 @@
+{
+  "string": [
+    {
+      "name": "page_show",
+      "value": "page from package"
+    },
+    {
+      "name": "request_reason",
+      "value": "api request"
+    }
+  ]
+}

+ 35 - 0
commoms/utils/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
commoms/utils/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 13 - 0
commoms/utils/src/ohosTest/module.json5

@@ -0,0 +1,13 @@
+{
+  "module": {
+    "name": "utils_test",
+    "type": "feature",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false
+  }
+}

+ 5 - 0
commoms/utils/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
commoms/utils/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 6 - 0
features/Authentication/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 17 - 0
features/Authentication/BuildProfile.ets

@@ -0,0 +1,17 @@
+/**
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
+ */
+export const HAR_VERSION = '1.0.0';
+export const BUILD_MODE_NAME = 'debug';
+export const DEBUG = true;
+export const TARGET_NAME = 'default';
+
+/**
+ * BuildProfile Class is used only for compatibility purposes.
+ */
+export default class BuildProfile { 
+	static readonly HAR_VERSION = HAR_VERSION;
+	static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
+	static readonly DEBUG = DEBUG;
+	static readonly TARGET_NAME = TARGET_NAME;
+}

+ 1 - 0
features/Authentication/Index.ets

@@ -0,0 +1 @@
+export { MainPage } from './src/main/ets/components/MainPage';

+ 31 - 0
features/Authentication/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": false,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          },
+          "consumerFiles": [
+            "./consumer-rules.txt"
+          ]
+        }
+      },
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest"
+    }
+  ]
+}

+ 0 - 0
features/Authentication/consumer-rules.txt


+ 6 - 0
features/Authentication/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { harTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 23 - 0
features/Authentication/obfuscation-rules.txt

@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation

+ 19 - 0
features/Authentication/oh-package-lock.json5

@@ -0,0 +1,19 @@
+{
+  "meta": {
+    "stableOrder": true,
+    "enableUnifiedLockfile": false
+  },
+  "lockfileVersion": 3,
+  "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
+  "specifiers": {
+    "utils@../../commoms/utils": "utils@../../commoms/utils"
+  },
+  "packages": {
+    "utils@../../commoms/utils": {
+      "name": "utils",
+      "version": "1.0.0",
+      "resolved": "../../commoms/utils",
+      "registryType": "local"
+    }
+  }
+}

+ 11 - 0
features/Authentication/oh-package.json5

@@ -0,0 +1,11 @@
+{
+  "name": "authentication",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "Index.ets",
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {
+    utils: "file:../../commoms/utils"
+  }
+}

+ 29 - 0
features/Authentication/src/main/ets/models/NormalLoginModel.ets

@@ -0,0 +1,29 @@
+export class NormalLoginModel{
+   private _phone: string
+
+   public set phone(value: string) {
+      this._phone = value
+   }
+
+   constructor(phone: string, password: string) {
+      this._phone = phone
+      this._password = password
+   }
+
+   public get phone(): string {
+      return this._phone
+   }
+
+   private _password: string
+
+   public set password(value: string) {
+      this._password = value
+   }
+
+   public get password(): string {
+      return this._password
+   }
+   public async login(){
+      // await
+   }
+}

+ 70 - 0
features/Authentication/src/main/ets/models/RegisterModel.ets

@@ -0,0 +1,70 @@
+export class RegisterModel{
+  private _phone: string
+
+  public set phone(value: string) {
+    this._phone = value
+  }
+
+  public get phone(): string {
+    return this._phone
+  }
+
+  private _username: string
+
+  public set username(value: string) {
+    this._username = value
+  }
+
+  public get username(): string {
+    return this._username
+  }
+
+  private _email: string
+
+  public set email(value: string) {
+    this._email = value
+  }
+
+  public get email(): string {
+    return this._email
+  }
+
+  private _password: string
+
+  public set password(value: string) {
+    this._password = value
+  }
+
+  public get password(): string {
+    return this._password
+  }
+
+  private _validCode: string
+
+  public set validCode(value: string) {
+    this._validCode = value
+  }
+
+  public get validCode(): string {
+    return this._validCode
+  }
+
+  private _IdNumber: string
+
+  public set IdNumber(value: string) {
+    this._IdNumber = value
+  }
+
+  public get IdNumber(): string {
+    return this._IdNumber
+  }
+  constructor(phone: string, username: string, email: string, password: string, validCode: string, IdNumber: string) {
+    this._phone = phone
+    this._username = username
+    this._email = email
+    this._password = password
+    this._validCode = validCode
+    this._IdNumber = IdNumber
+  }
+
+}

+ 21 - 0
features/Authentication/src/main/ets/models/ValidCodeLoginModel.ets

@@ -0,0 +1,21 @@
+export class NormalLoginModel{
+   private _phone: string
+
+   constructor(phone: string, validCode: string) {
+      this._phone = phone
+      this._validCode = validCode
+   }
+
+   public get phone(): string {
+      return this._phone
+   }
+
+   private _validCode: string
+
+   public get validCode(): string {
+      return this._validCode
+   }
+   public async login(){
+      // await
+   }
+}

+ 15 - 0
features/Authentication/src/main/ets/pages/AuthPage.ets

@@ -0,0 +1,15 @@
+import { NormalLoginModel } from "../models/NormalLoginModel";
+import { Constants } from 'utils';
+
+@ComponentV2
+export struct AuthPage{
+
+  build() {
+    Column(){
+      Text('登录页')
+    }
+    .alignItems(HorizontalAlign.Center)
+      .width(Constants.FULL_WITH)
+      .height(Constants.FULL_HEIGHT)
+  }
+}

+ 11 - 0
features/Authentication/src/main/module.json5

@@ -0,0 +1,11 @@
+{
+  "module": {
+    "name": "Authentication",
+    "type": "har",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ]
+  }
+}

+ 8 - 0
features/Authentication/src/main/resources/base/element/float.json

@@ -0,0 +1,8 @@
+{
+  "float": [
+    {
+      "name": "page_text_font_size",
+      "value": "50fp"
+    }
+  ]
+}

+ 8 - 0
features/Authentication/src/main/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "page_show",
+      "value": "page from package"
+    }
+  ]
+}

+ 35 - 0
features/Authentication/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
features/Authentication/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 13 - 0
features/Authentication/src/ohosTest/module.json5

@@ -0,0 +1,13 @@
+{
+  "module": {
+    "name": "Authentication_test",
+    "type": "feature",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false
+  }
+}

+ 5 - 0
features/Authentication/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
features/Authentication/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 6 - 0
features/Hello/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 17 - 0
features/Hello/BuildProfile.ets

@@ -0,0 +1,17 @@
+/**
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
+ */
+export const HAR_VERSION = '1.0.0';
+export const BUILD_MODE_NAME = 'debug';
+export const DEBUG = true;
+export const TARGET_NAME = 'default';
+
+/**
+ * BuildProfile Class is used only for compatibility purposes.
+ */
+export default class BuildProfile { 
+	static readonly HAR_VERSION = HAR_VERSION;
+	static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
+	static readonly DEBUG = DEBUG;
+	static readonly TARGET_NAME = TARGET_NAME;
+}

+ 2 - 0
features/Hello/Index.ets

@@ -0,0 +1,2 @@
+export {HelloPage} from './src/main/ets/pages/HelloPage'
+

+ 31 - 0
features/Hello/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": false,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          },
+          "consumerFiles": [
+            "./consumer-rules.txt"
+          ]
+        }
+      },
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest"
+    }
+  ]
+}

+ 0 - 0
features/Hello/consumer-rules.txt


+ 6 - 0
features/Hello/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { harTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 23 - 0
features/Hello/obfuscation-rules.txt

@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation

+ 9 - 0
features/Hello/oh-package.json5

@@ -0,0 +1,9 @@
+{
+  "name": "hello",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "Index.ets",
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {}
+}

+ 15 - 0
features/Hello/src/main/ets/model/Message.ets

@@ -0,0 +1,15 @@
+
+export class Message{
+  private _content: string = "";
+
+  public get content(): string {
+    return this._content;
+  }
+
+  public set content(value: string) {
+    this._content = value;
+  }
+  public loadContent(){
+    this._content = "Hello World"
+  }
+}

+ 26 - 0
features/Hello/src/main/ets/pages/HelloPage.ets

@@ -0,0 +1,26 @@
+import { MessageViewModel } from '../viewmodel/MessageViewModel'
+
+@ComponentV2
+export struct HelloPage {
+  @Local myMessage:MessageViewModel = new MessageViewModel();
+  aboutToAppear(): void {
+    this.myMessage.loadContent()
+  }
+  build() {
+    RelativeContainer() {
+      Text(this.myMessage.getMessage())
+        .id('HelloWorld')
+        .fontSize($r('app.float.page_text_font_size'))
+        .fontWeight(FontWeight.Bold)
+        .alignRules({
+          center: { anchor: '__container__', align: VerticalAlign.Center },
+          middle: { anchor: '__container__', align: HorizontalAlign.Center }
+        })
+        .onClick(() => {
+          this.myMessage.setMessage('Welcome');
+        })
+    }
+    .height('100%')
+    .width('100%')
+  }
+}

+ 17 - 0
features/Hello/src/main/ets/viewmodel/MessageViewModel.ets

@@ -0,0 +1,17 @@
+import { Message } from "../model/Message";
+
+@ObservedV2
+export class MessageViewModel{
+  @Trace message:string = "";
+  public loadContent(){
+    let temp = new Message();
+    temp.loadContent();;
+    this.message = temp.content;
+  }
+  public getMessage():string{
+    return this.message;
+  }
+  public setMessage(str:string){
+    this.message = str;
+  }
+}

+ 11 - 0
features/Hello/src/main/module.json5

@@ -0,0 +1,11 @@
+{
+  "module": {
+    "name": "Hello",
+    "type": "har",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ]
+  }
+}

+ 8 - 0
features/Hello/src/main/resources/base/element/float.json

@@ -0,0 +1,8 @@
+{
+  "float": [
+    {
+      "name": "page_text_font_size",
+      "value": "50fp"
+    }
+  ]
+}

+ 8 - 0
features/Hello/src/main/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "page_show",
+      "value": "page from package"
+    }
+  ]
+}

+ 35 - 0
features/Hello/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
features/Hello/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 13 - 0
features/Hello/src/ohosTest/module.json5

@@ -0,0 +1,13 @@
+{
+  "module": {
+    "name": "Hello_test",
+    "type": "feature",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false
+  }
+}

+ 5 - 0
features/Hello/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
features/Hello/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 6 - 0
features/Home/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 17 - 0
features/Home/BuildProfile.ets

@@ -0,0 +1,17 @@
+/**
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
+ */
+export const HAR_VERSION = '1.0.0';
+export const BUILD_MODE_NAME = 'debug';
+export const DEBUG = true;
+export const TARGET_NAME = 'default';
+
+/**
+ * BuildProfile Class is used only for compatibility purposes.
+ */
+export default class BuildProfile { 
+	static readonly HAR_VERSION = HAR_VERSION;
+	static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
+	static readonly DEBUG = DEBUG;
+	static readonly TARGET_NAME = TARGET_NAME;
+}

+ 1 - 0
features/Home/Index.ets

@@ -0,0 +1 @@
+// export { MainPage } from './src/main/ets/components/MainPage';

+ 31 - 0
features/Home/build-profile.json5

@@ -0,0 +1,31 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": false,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          },
+          "consumerFiles": [
+            "./consumer-rules.txt"
+          ]
+        }
+      },
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest"
+    }
+  ]
+}

+ 0 - 0
features/Home/consumer-rules.txt


+ 6 - 0
features/Home/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { harTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 23 - 0
features/Home/obfuscation-rules.txt

@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation

+ 9 - 0
features/Home/oh-package.json5

@@ -0,0 +1,9 @@
+{
+  "name": "home",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "Index.ets",
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {}
+}

+ 11 - 0
features/Home/src/main/module.json5

@@ -0,0 +1,11 @@
+{
+  "module": {
+    "name": "Home",
+    "type": "har",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ]
+  }
+}

+ 8 - 0
features/Home/src/main/resources/base/element/float.json

@@ -0,0 +1,8 @@
+{
+  "float": [
+    {
+      "name": "page_text_font_size",
+      "value": "50fp"
+    }
+  ]
+}

+ 8 - 0
features/Home/src/main/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "page_show",
+      "value": "page from package"
+    }
+  ]
+}

+ 35 - 0
features/Home/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
features/Home/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 13 - 0
features/Home/src/ohosTest/module.json5

@@ -0,0 +1,13 @@
+{
+  "module": {
+    "name": "Home_test",
+    "type": "feature",
+    "deviceTypes": [
+      "default",
+      "tablet",
+      "2in1"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false
+  }
+}

+ 5 - 0
features/Home/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
features/Home/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 6 - 0
features/SignIn/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 17 - 0
features/SignIn/BuildProfile.ets

@@ -0,0 +1,17 @@
+/**
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
+ */
+export const HAR_VERSION = '1.0.0';
+export const BUILD_MODE_NAME = 'debug';
+export const DEBUG = true;
+export const TARGET_NAME = 'default';
+
+/**
+ * BuildProfile Class is used only for compatibility purposes.
+ */
+export default class BuildProfile { 
+	static readonly HAR_VERSION = HAR_VERSION;
+	static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
+	static readonly DEBUG = DEBUG;
+	static readonly TARGET_NAME = TARGET_NAME;
+}

Some files were not shown because too many files changed in this diff