@nocobase/plugin-action-custom-request 2.1.0-beta.25 → 2.1.0-beta.27
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/dist/externalVersion.js
CHANGED
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.27",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-i18next": "11.18.6",
|
|
14
14
|
"@formily/react": "2.3.7",
|
|
15
|
-
"@nocobase/logger": "2.1.0-beta.
|
|
16
|
-
"@nocobase/server": "2.1.0-beta.
|
|
17
|
-
"@nocobase/test": "2.1.0-beta.
|
|
15
|
+
"@nocobase/logger": "2.1.0-beta.27",
|
|
16
|
+
"@nocobase/server": "2.1.0-beta.27",
|
|
17
|
+
"@nocobase/test": "2.1.0-beta.27",
|
|
18
18
|
"@formily/antd-v5": "1.2.3",
|
|
19
19
|
"lodash": "4.18.1",
|
|
20
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
20
|
+
"@nocobase/utils": "2.1.0-beta.27",
|
|
21
21
|
"antd": "5.24.2",
|
|
22
22
|
"file-saver": "2.0.5",
|
|
23
23
|
"@formily/shared": "2.3.7",
|
|
24
|
-
"@nocobase/flow-engine": "2.1.0-beta.
|
|
24
|
+
"@nocobase/flow-engine": "2.1.0-beta.27",
|
|
25
25
|
"@emotion/css": "11.13.0",
|
|
26
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
27
|
-
"@nocobase/evaluators": "2.1.0-beta.
|
|
26
|
+
"@nocobase/actions": "2.1.0-beta.27",
|
|
27
|
+
"@nocobase/evaluators": "2.1.0-beta.27",
|
|
28
28
|
"axios": "1.7.7",
|
|
29
|
-
"@nocobase/database": "2.1.0-beta.
|
|
29
|
+
"@nocobase/database": "2.1.0-beta.27"
|
|
30
30
|
};
|
|
@@ -109,6 +109,15 @@ const getParsedValue = (value, variables) => {
|
|
|
109
109
|
});
|
|
110
110
|
return template(variables);
|
|
111
111
|
};
|
|
112
|
+
const getRequestBaseURL = (ctx) => {
|
|
113
|
+
if (ctx.protocol && ctx.host) {
|
|
114
|
+
return `${ctx.protocol}://${ctx.host}`;
|
|
115
|
+
}
|
|
116
|
+
if (ctx.href) {
|
|
117
|
+
return new URL(ctx.href).origin;
|
|
118
|
+
}
|
|
119
|
+
return void 0;
|
|
120
|
+
};
|
|
112
121
|
async function send(ctx, next) {
|
|
113
122
|
var _a, _b, _c, _d;
|
|
114
123
|
const resourceName = ctx.action.resourceName;
|
|
@@ -200,7 +209,7 @@ async function send(ctx, next) {
|
|
|
200
209
|
};
|
|
201
210
|
applyVarsToVariables(variables, vars);
|
|
202
211
|
const axiosRequestConfig = {
|
|
203
|
-
baseURL: ctx
|
|
212
|
+
baseURL: getRequestBaseURL(ctx),
|
|
204
213
|
...options,
|
|
205
214
|
// safeRequest checks this url value (before baseURL combination) so that
|
|
206
215
|
// relative paths pointing to the same server are not subject to the whitelist.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-action-custom-request",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.27",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/action-custom-request",
|
|
6
6
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/action-custom-request",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@nocobase/server": "2.x",
|
|
32
32
|
"@nocobase/test": "2.x"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "6d9e2d4ac3c6bf40951c8eb252860e47aa3a3c37",
|
|
35
35
|
"keywords": [
|
|
36
36
|
"Actions"
|
|
37
37
|
]
|