@lark-apaas/miaoda-core 0.0.1-alpha.3 → 0.0.1-alpha.5
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,30 +24,37 @@ async function getLogJson() {
|
|
24
24
|
}
|
25
25
|
async function api_get(url, config) {
|
26
26
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
27
|
-
|
27
|
+
const res = await core.get(`${basePath}${url}`, config);
|
28
|
+
return res;
|
28
29
|
}
|
29
30
|
async function api_post(url, data, config) {
|
30
31
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
31
|
-
|
32
|
+
const res = await core.post(`${basePath}${url}`, data, config);
|
33
|
+
return res;
|
32
34
|
}
|
33
35
|
async function api_put(url, data, config) {
|
34
36
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
35
|
-
|
37
|
+
const res = await core.put(`${basePath}${url}`, data, config);
|
38
|
+
return res;
|
36
39
|
}
|
37
40
|
async function api_delete(url, config) {
|
38
41
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
39
|
-
|
42
|
+
const res = await core["delete"](`${basePath}${url}`, config);
|
43
|
+
return res;
|
40
44
|
}
|
41
45
|
async function api_patch(url, data, config) {
|
42
46
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
43
|
-
|
47
|
+
const res = await core.patch(`${basePath}${url}`, data, config);
|
48
|
+
return res;
|
44
49
|
}
|
45
50
|
async function api_head(url, config) {
|
46
51
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
47
|
-
|
52
|
+
const res = await core.head(`${basePath}${url}`, config);
|
53
|
+
return res;
|
48
54
|
}
|
49
55
|
async function api_options(url, config) {
|
50
56
|
const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
|
51
|
-
|
57
|
+
const res = await core.options(`${basePath}${url}`, config);
|
58
|
+
return res;
|
52
59
|
}
|
53
60
|
export { api_delete, api_get, api_head, api_options, api_patch, api_post, api_put, getLogJson, getOpenApiJson };
|