@gct-paas/api 0.1.6-dev.0 → 0.1.6-dev.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.
|
@@ -2,16 +2,24 @@ import dsBridge from "dsbridge";
|
|
|
2
2
|
import qs from "qs";
|
|
3
3
|
export const NativeHTTP = {
|
|
4
4
|
request(querydata) {
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const {
|
|
6
|
+
method,
|
|
7
|
+
url,
|
|
8
|
+
timeout,
|
|
9
|
+
params,
|
|
10
|
+
headers,
|
|
11
|
+
data,
|
|
12
|
+
baseURL = ""
|
|
13
|
+
} = querydata;
|
|
14
|
+
const pathParam = "?" + qs.stringify(params);
|
|
15
|
+
const allUrl = (baseURL + url).replace(/([^:])\/\//g, "$1/") + pathParam;
|
|
16
|
+
console.info(allUrl + ">>HTTP", querydata);
|
|
9
17
|
const startTime = performance.now();
|
|
10
18
|
return new Promise((resolve, reject) => {
|
|
11
19
|
dsBridge.call(
|
|
12
20
|
"HTTP." + method,
|
|
13
21
|
{
|
|
14
|
-
url:
|
|
22
|
+
url: allUrl,
|
|
15
23
|
timeout,
|
|
16
24
|
headers,
|
|
17
25
|
data: data && typeof data === "string" ? JSON.parse(data) : data
|
|
@@ -19,7 +27,7 @@ export const NativeHTTP = {
|
|
|
19
27
|
function(res) {
|
|
20
28
|
const nativeData = JSON.parse(res);
|
|
21
29
|
console.info(
|
|
22
|
-
|
|
30
|
+
`${allUrl} >> HTTP.response - \u8017\u65F6\uFF1A${performance.now() - startTime}`,
|
|
23
31
|
nativeData
|
|
24
32
|
);
|
|
25
33
|
if (nativeData.code === 0 && nativeData.http_code === 200) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/api",
|
|
3
|
-
"version": "0.1.6-dev.
|
|
3
|
+
"version": "0.1.6-dev.2",
|
|
4
4
|
"description": "paas 平台底包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"lib"
|
|
55
55
|
],
|
|
56
56
|
"scripts": {
|
|
57
|
-
"build": "
|
|
57
|
+
"build": "vite build && unbuild",
|
|
58
58
|
"lint": "eslint './src' --fix",
|
|
59
59
|
"test": "vitest",
|
|
60
60
|
"test:run": "vitest run",
|
|
@@ -69,39 +69,36 @@
|
|
|
69
69
|
"gen-api:test": "./script/gen-api.sh"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"axios": "^1.
|
|
72
|
+
"axios": "^1.16.0",
|
|
73
73
|
"dsbridge": "^3.1.4",
|
|
74
|
-
"lodash-es": "^4.
|
|
75
|
-
"qs": "^6.
|
|
74
|
+
"lodash-es": "^4.18.1",
|
|
75
|
+
"qs": "^6.15.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"axios": "^1.13.x"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@babel/preset-env": "^7.
|
|
82
|
-
"@commitlint/cli": "^20.3
|
|
81
|
+
"@babel/preset-env": "^7.29.5",
|
|
82
|
+
"@commitlint/cli": "^20.5.3",
|
|
83
83
|
"@gct-paas/build": "^0.1.12",
|
|
84
84
|
"@gct-paas/cli": "^0.1.19",
|
|
85
|
-
"@rollup/plugin-commonjs": "^29.0.0",
|
|
86
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
87
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
88
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
89
85
|
"@types/fs-extra": "^11.0.4",
|
|
90
86
|
"@types/lodash-es": "^4.17.12",
|
|
91
|
-
"@types/node": "^25.
|
|
92
|
-
"@types/qs": "^6.
|
|
87
|
+
"@types/node": "^25.6.2",
|
|
88
|
+
"@types/qs": "^6.15.1",
|
|
93
89
|
"@types/systemjs": "^6.15.4",
|
|
94
90
|
"@vue/tsconfig": "^0.8.1",
|
|
95
|
-
"eslint": "^9.39.
|
|
91
|
+
"eslint": "^9.39.4",
|
|
92
|
+
"eslint-config-prettier": "^10.1.8",
|
|
93
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
94
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
96
95
|
"husky": "^9.1.7",
|
|
97
|
-
"lint-staged": "^16.
|
|
98
|
-
"prettier": "^3.8.
|
|
99
|
-
"
|
|
100
|
-
"rollup": "^4.56.0",
|
|
101
|
-
"rollup-plugin-esbuild": "^6.2.1",
|
|
96
|
+
"lint-staged": "^16.4.0",
|
|
97
|
+
"prettier": "^3.8.3",
|
|
98
|
+
"terser": "^5.47.1",
|
|
102
99
|
"ts-node": "^10.9.2",
|
|
103
|
-
"tsdown": "^0.21.4",
|
|
104
100
|
"typescript": "^5.9.3",
|
|
105
|
-
"unbuild": "^3.6.1"
|
|
101
|
+
"unbuild": "^3.6.1",
|
|
102
|
+
"vite": "^8.0.12"
|
|
106
103
|
}
|
|
107
104
|
}
|