autobots-commonlib 1.3.5 → 1.3.6
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/.idea/workspace.xml +14 -7
- package/README.md +3 -0
- package/lib/QCRNetworkModule.js +14 -0
- package/package.json +1 -1
package/.idea/workspace.xml
CHANGED
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="30c1af58-4d10-4799-8434-f7c14eade97a" name="Default Changelist" comment="
|
|
7
|
+
<list default="true" id="30c1af58-4d10-4799-8434-f7c14eade97a" name="Default Changelist" comment="">
|
|
8
8
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
|
10
|
-
<change beforePath="$PROJECT_DIR$/lib/QCRNetworkModule.js" beforeDir="false" afterPath="$PROJECT_DIR$/lib/QCRNetworkModule.js" afterDir="false" />
|
|
11
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
12
9
|
</list>
|
|
13
10
|
<option name="SHOW_DIALOG" value="false" />
|
|
14
11
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -320,7 +317,8 @@
|
|
|
320
317
|
<workItem from="1713170876054" duration="10998000" />
|
|
321
318
|
<workItem from="1715841212364" duration="699000" />
|
|
322
319
|
<workItem from="1716272524681" duration="9005000" />
|
|
323
|
-
<workItem from="1716814998133" duration="
|
|
320
|
+
<workItem from="1716814998133" duration="2987000" />
|
|
321
|
+
<workItem from="1717124536462" duration="598000" />
|
|
324
322
|
</task>
|
|
325
323
|
<task id="LOCAL-00001" summary="1、增加新组件NewNavbar; 2、修改jump方法,增加一个参数;">
|
|
326
324
|
<created>1561551696357</created>
|
|
@@ -513,7 +511,15 @@
|
|
|
513
511
|
<option name="project" value="LOCAL" />
|
|
514
512
|
<updated>1716813889290</updated>
|
|
515
513
|
</task>
|
|
516
|
-
<
|
|
514
|
+
<task id="LOCAL-00026" summary="更新asyncFetch和asyncPostForm传递的参数,使用更严谨方式判断,防止非字符串型参数也传""的错误处理">
|
|
515
|
+
<option name="closed" value="true" />
|
|
516
|
+
<created>1716815699201</created>
|
|
517
|
+
<option name="number" value="00026" />
|
|
518
|
+
<option name="presentableId" value="LOCAL-00026" />
|
|
519
|
+
<option name="project" value="LOCAL" />
|
|
520
|
+
<updated>1716815699201</updated>
|
|
521
|
+
</task>
|
|
522
|
+
<option name="localTasksCounter" value="27" />
|
|
517
523
|
<servers />
|
|
518
524
|
</component>
|
|
519
525
|
<component name="TimeTrackingManager">
|
|
@@ -636,7 +642,8 @@
|
|
|
636
642
|
<MESSAGE value="修改主软件网络库的js桥接代码,兼容js的fetch缓存方法" />
|
|
637
643
|
<MESSAGE value="更新版本号到1.3.3" />
|
|
638
644
|
<MESSAGE value="处理asyncFetch和asyncPostForm传递的参数为null的场景" />
|
|
639
|
-
<
|
|
645
|
+
<MESSAGE value="更新asyncFetch和asyncPostForm传递的参数,使用更严谨方式判断,防止非字符串型参数也传""的错误处理" />
|
|
646
|
+
<option name="LAST_COMMIT_MESSAGE" value="更新asyncFetch和asyncPostForm传递的参数,使用更严谨方式判断,防止非字符串型参数也传""的错误处理" />
|
|
640
647
|
</component>
|
|
641
648
|
<component name="editorHistoryManager">
|
|
642
649
|
<entry file="file://$PROJECT_DIR$/window.js">
|
package/README.md
CHANGED
package/lib/QCRNetworkModule.js
CHANGED
|
@@ -96,6 +96,20 @@ async function asyncFetch(url: String, config: Object, params: Object, cacheFunc
|
|
|
96
96
|
let needReadCache = (config && config.method && config.method.indexOf('cache') >= 0) ? true : false;
|
|
97
97
|
if (needReadCache && cacheFunction) {
|
|
98
98
|
try {
|
|
99
|
+
if (Platform.OS === 'android') {
|
|
100
|
+
//处理body为form类型要将param全部字段转为字条串类型,与请求网络接口写缓存时类型一致
|
|
101
|
+
if (params && config && config.headers) {
|
|
102
|
+
if (!(config.headers['Content-Type'] && config.headers['Content-Type'].indexOf('application/json') >= 0)) {
|
|
103
|
+
const stringFieldParams = {};
|
|
104
|
+
Object.keys(params).forEach(key => {
|
|
105
|
+
if (typeof params[key] !== 'undefined' && params[key] !== null) {
|
|
106
|
+
stringFieldParams[key] = String(params[key]);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
params = stringFieldParams;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
99
113
|
let response = await QCRRNNetworkModule.getCacheData(url, params);
|
|
100
114
|
if (typeof response === 'string') {
|
|
101
115
|
if (response.trim() != '') {
|