@react-native-ohos/react-native-fileupload 1.2.0 → 1.2.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # @react-native-ohos/react-native-fileupload
2
2
  This project is based on [react-native-fileupload V1.1.0](https://github.com/PhilippKrone/react-native-fileupload)
3
3
  ## Documentation
4
- [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-fileupload.md)
4
+ [中文](https://gitcode.com/CPF-RN/usage-docs/blob/master/zh-cn/react-native-fileupload.md)
5
5
 
6
- [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-fileupload.md)
6
+ [English](https://gitcode.com/CPF-RN/usage-docs/blob/master/en/react-native-fileupload.md)
7
7
 
8
8
  ## License
9
- This library is licensed under [MIT License (MIT)](https://github.com/react-native-oh-library/react-native-fileupload/blob/sig/LICENSE).
9
+ This library is licensed under [MIT License (MIT)](https://gitcode.com/CPF-RN/rntpc_react-native-fileupload/blob/br_rnoh0.77/LICENSE).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-ohos/react-native-fileupload",
3
- "version": "1.2.0",
3
+ "version": "1.2.1-beta.2",
4
4
  "description": "A file upload plugin for react-native.",
5
5
  "main": "index.ets",
6
6
  "author": "",
@@ -46,11 +46,14 @@ export class FileUpLoadModule extends TurboModule implements TM.RNFileupload.Spe
46
46
  };
47
47
  let filesItem = options['files'][index];
48
48
  Object.filename = filesItem['filename'];
49
- let path = filesItem['filepath'].substring(0, filesItem['filepath'].lastIndexOf('/'));
50
- if (path == this.ctx.uiAbilityContext.cacheDir || path == 'file://' + this.ctx.uiAbilityContext.cacheDir) {
51
- Object.uri = 'internal://cache/' + filesItem['filename'];
52
- } else if (filesItem['filepath'] == 'internal://cache/' + filesItem['filename']) {
53
- Object.uri = filesItem['filepath'];
49
+ let cacheDir = this.ctx.uiAbilityContext.cacheDir;
50
+ let filepath = filesItem['filepath'];
51
+ if (filepath.startsWith(cacheDir + '/')) {
52
+ Object.uri = 'internal://cache/' + filepath.substring(cacheDir.length + 1);
53
+ } else if (filepath.startsWith('file://' + cacheDir + '/')) {
54
+ Object.uri = 'internal://cache/' + filepath.substring(('file://' + cacheDir).length + 1);
55
+ } else if (filepath.startsWith('internal://cache/')) {
56
+ Object.uri = filepath;
54
57
  }
55
58
 
56
59
  let i = filesItem['filename'].lastIndexOf('.')
Binary file
package/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,16 +1,24 @@
1
1
  {
2
2
  "name": "@react-native-ohos/react-native-fileupload",
3
- "version": "1.2.0",
3
+ "version": "1.2.1-beta.2",
4
4
  "description": "A file upload plugin for react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "codegen-lib": "react-native codegen-lib-harmony --no-safety-check --npm-package-name react-native-fileupload --cpp-output-path ./harmony/fileUpload/src/main/cpp/generated --ets-output-path ./harmony/fileUpload/src/main/ets/generated --turbo-modules-spec-paths ./NativeRNFileupload.ts"
8
+ "codegen-lib": "react-native codegen-lib-harmony --no-safety-check --npm-package-name react-native-fileupload --cpp-output-path ./harmony/fileUpload/src/main/cpp/generated --ets-output-path ./harmony/fileUpload/src/main/ets/generated --turbo-modules-spec-paths ./NativeRNFileupload.ts",
9
+ "pack": "npm pack"
9
10
  },
10
11
  "repository": {
11
12
  "type": "git",
12
- "url": "https://gitcode.com/openharmony-sig/rntpc_react-native-fileupload"
13
+ "url": "https://gitcode.com/CPF-RN/rntpc_react-native-fileupload"
13
14
  },
15
+ "files": [
16
+ "harmony",
17
+ "index.js",
18
+ "NativeRNFileupload.ts",
19
+ "CHANGELOG.md",
20
+ "COMMITTERS.md"
21
+ ],
14
22
  "keywords": [
15
23
  "harmony",
16
24
  "react-component",
@@ -34,10 +42,10 @@
34
42
  "@react-native-community/cli": "latest"
35
43
  },
36
44
  "bugs": {
37
- "url": "https://gitcode.com/openharmony-sig/rntpc_react-native-fileupload/issues"
45
+ "url": "https://gitcode.com/CPF-RN/rntpc_react-native-fileupload/issues"
38
46
  },
39
47
  "publishConfig": {
40
48
  "registry": "https://registry.npmjs.org/",
41
49
  "access": "public"
42
50
  }
43
- }
51
+ }
@@ -1,38 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <configuration>
3
- <oatconfig>
4
- <licensefile>LICENSE</licensefile>
5
- <filefilterlist>
6
- <filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
7
- <filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加版权头"/>
8
- <filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加版权头"/>
9
- <filteritem type="filename" name="*.proto" desc="资源文件,不需要添加版权头"/>
10
- <filteritem type="filename" name="*.json" desc="资源文件,不需要添加版权头"/>
11
- <filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
12
- <filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
13
- <filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
14
- <filteritem type="filename" name="LICENSE" desc="工程文件,不修改版权头"/>
15
- </filefilter>
16
- <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
17
- <filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加许可证头"/>
18
- <filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加许可证头"/>
19
- <filteritem type="filename" name="LICENSE" desc="原三方库证书文件无需更改,因此添加过滤"/>
20
- <filteritem type="filename" name="*.proto" desc="资源文件,不需要添加许可证头"/>
21
- <filteritem type="filename" name="*.json" desc="资源文件,不需要添加许可证头"/>
22
- <filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
23
- <filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
24
- <filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
25
- </filefilter>
26
- <filefilter name="binaryFileTypePolicyFilter" desc="Filters for resources files policies">
27
- <filteritem type="filename" name="icon.png" desc="应用图标"/>
28
- <filteritem type="filename" name="app_icon.png" desc="应用图标"/>
29
- <filteritem type="filename" name="warn.png" desc="页面展示图标"/>
30
- </filefilter>
31
- </filefilterlist>
32
- <policylist>
33
- <policy name="projectPolicy" desc="">
34
- <policyitem type="license" name="MIT" path=".*" desc="license under the MIT"/>
35
- </policy>
36
- </policylist>
37
- </oatconfig>
38
- </configuration>