@lark-apaas/miaoda-core 0.0.1-alpha.2 → 0.0.1-alpha.3
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.
@@ -24,61 +24,30 @@ async function getLogJson() {
|
|
24
24
|
}
|
25
25
|
async function api_get(url, config) {
|
26
26
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
27
|
-
return core.get({
|
28
|
-
...config,
|
29
|
-
url: `${basePath}${url}`,
|
30
|
-
method: 'GET'
|
31
|
-
});
|
27
|
+
return core.get(`${basePath}${url}`, config);
|
32
28
|
}
|
33
29
|
async function api_post(url, data, config) {
|
34
30
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
35
|
-
return core.post({
|
36
|
-
...config,
|
37
|
-
url: `${basePath}${url}`,
|
38
|
-
method: 'POST',
|
39
|
-
data
|
40
|
-
});
|
31
|
+
return core.post(`${basePath}${url}`, data, config);
|
41
32
|
}
|
42
33
|
async function api_put(url, data, config) {
|
43
34
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
44
|
-
return core.put({
|
45
|
-
...config,
|
46
|
-
url: `${basePath}${url}`,
|
47
|
-
method: 'PUT',
|
48
|
-
data
|
49
|
-
});
|
35
|
+
return core.put(`${basePath}${url}`, data, config);
|
50
36
|
}
|
51
37
|
async function api_delete(url, config) {
|
52
38
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
53
|
-
return core["delete"]({
|
54
|
-
...config,
|
55
|
-
url: `${basePath}${url}`,
|
56
|
-
method: 'DELETE'
|
57
|
-
});
|
39
|
+
return core["delete"](`${basePath}${url}`, config);
|
58
40
|
}
|
59
41
|
async function api_patch(url, data, config) {
|
60
42
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
61
|
-
return core.patch({
|
62
|
-
...config,
|
63
|
-
url: `${basePath}${url}`,
|
64
|
-
method: 'PATCH',
|
65
|
-
data
|
66
|
-
});
|
43
|
+
return core.patch(`${basePath}${url}`, data, config);
|
67
44
|
}
|
68
45
|
async function api_head(url, config) {
|
69
46
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
70
|
-
return core.head({
|
71
|
-
...config,
|
72
|
-
url: `${basePath}${url}`,
|
73
|
-
method: 'HEAD'
|
74
|
-
});
|
47
|
+
return core.head(`${basePath}${url}`, config);
|
75
48
|
}
|
76
49
|
async function api_options(url, config) {
|
77
50
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
78
|
-
return core.options({
|
79
|
-
...config,
|
80
|
-
url: `${basePath}${url}`,
|
81
|
-
method: 'OPTIONS'
|
82
|
-
});
|
51
|
+
return core.options(`${basePath}${url}`, config);
|
83
52
|
}
|
84
53
|
export { api_delete, api_get, api_head, api_options, api_patch, api_post, api_put, getLogJson, getOpenApiJson };
|