esoftplay 0.0.269-beta8d1f009 → 0.0.269-beta934b397
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/modules/lib/curl.ts +7 -10
- package/package.json +1 -1
package/modules/lib/curl.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import esp from 'esoftplay/esp';
|
|
5
5
|
import { LibCrypt } from 'esoftplay/cache/lib/crypt/import';
|
|
6
6
|
import { reportApiError } from "esoftplay/error";
|
|
7
|
-
import { File } from 'expo-file-system';
|
|
8
7
|
|
|
9
8
|
//api_logger_import
|
|
10
9
|
|
|
@@ -31,7 +30,7 @@ export default class m {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
constructor(uri?: string, post?: any, onDone?: (res: any, msg: string) => void, onFailed?: (error: any, timeout: boolean) => void, debug?: number) {
|
|
34
|
-
this.header = { version:
|
|
33
|
+
this.header = { version: esp.config()?.publish_id }
|
|
35
34
|
// this.maxRetry = 2;
|
|
36
35
|
this.setUri = this.setUri.bind(this);
|
|
37
36
|
this.setUrl = this.setUrl.bind(this);
|
|
@@ -357,12 +356,11 @@ export default class m {
|
|
|
357
356
|
if (post) {
|
|
358
357
|
if (upload) {
|
|
359
358
|
let fd = new FormData();
|
|
360
|
-
|
|
359
|
+
Object.keys(post).map(function (key) {
|
|
361
360
|
if (post[key] !== undefined) {
|
|
362
|
-
|
|
363
|
-
fd.append(key, file as any, post[key].name)
|
|
361
|
+
fd.append(key, post[key])
|
|
364
362
|
}
|
|
365
|
-
})
|
|
363
|
+
});
|
|
366
364
|
this.post = fd
|
|
367
365
|
} else {
|
|
368
366
|
let ps = Object.keys(post).map((key) => {
|
|
@@ -385,11 +383,10 @@ export default class m {
|
|
|
385
383
|
this.setUrl(esp.config("url"))
|
|
386
384
|
}
|
|
387
385
|
await this.setHeader();
|
|
388
|
-
if (
|
|
389
|
-
this.header["Content-Type"] = "
|
|
386
|
+
if (upload)
|
|
387
|
+
this.header["Content-Type"] = "multipart/form-data"
|
|
390
388
|
else
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
this.header["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8"
|
|
393
390
|
let options: any = {
|
|
394
391
|
method: !this.post ? "GET" : "POST",
|
|
395
392
|
headers: this.header,
|
package/package.json
CHANGED