@byted-apaas/server-sdk-node 1.1.14-beta.1 → 1.1.14-beta.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.
- package/package.json +1 -1
- package/request/openapi.js +7 -10
package/package.json
CHANGED
package/request/openapi.js
CHANGED
|
@@ -11,6 +11,7 @@ const constants_3 = require("@byted-apaas/server-common-node/constants/constants
|
|
|
11
11
|
const common_1 = require("./common");
|
|
12
12
|
const utils_1 = require("@byted-apaas/server-common-node/utils/utils");
|
|
13
13
|
const permissionUtils = require("@byted-apaas/server-common-node/utils/permissionUtils");
|
|
14
|
+
const { URLSearchParams } = require('url');
|
|
14
15
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
16
|
const nodeCls = require('node-cls'); //nolint:byted_s_ts_no_require_imports
|
|
16
17
|
const fs = require('fs');
|
|
@@ -977,18 +978,14 @@ class RequestHttp {
|
|
|
977
978
|
let options = commonHttp.getOptions(null, constants_2.openapiHttpPath.getApprovalInstance);
|
|
978
979
|
let urlPath = options._reqPath.replace(replaceKeys.id, String(params.approvalInstanceId));
|
|
979
980
|
// 设置参数
|
|
980
|
-
const searchParams =
|
|
981
|
-
includes: "",
|
|
982
|
-
};
|
|
983
|
-
const includes = [];
|
|
981
|
+
const searchParams = new URLSearchParams();
|
|
984
982
|
if (params && params.includeContent) {
|
|
985
|
-
|
|
983
|
+
searchParams.append('includes', 'ApprovalComment_Content');
|
|
986
984
|
}
|
|
987
985
|
if (params && params.includeFormData) {
|
|
988
|
-
|
|
986
|
+
searchParams.append('includes', 'ApprovalTask_FormData');
|
|
989
987
|
}
|
|
990
|
-
|
|
991
|
-
options.searchParams = searchParams;
|
|
988
|
+
urlPath = urlPath + '?' + searchParams.toString();
|
|
992
989
|
// 发起请求
|
|
993
990
|
let resp = await openapi.doRequest(null, urlPath, options);
|
|
994
991
|
if (!resp || !resp.approval_instance) {
|
|
@@ -1005,7 +1002,7 @@ class RequestHttp {
|
|
|
1005
1002
|
tasks: [],
|
|
1006
1003
|
comments: [],
|
|
1007
1004
|
};
|
|
1008
|
-
if (
|
|
1005
|
+
if (approvalInstance.tasks && Array.isArray(approvalInstance.tasks)) {
|
|
1009
1006
|
for (let task of approvalInstance.tasks) {
|
|
1010
1007
|
result.tasks.push({
|
|
1011
1008
|
id: task.id,
|
|
@@ -1021,7 +1018,7 @@ class RequestHttp {
|
|
|
1021
1018
|
});
|
|
1022
1019
|
}
|
|
1023
1020
|
}
|
|
1024
|
-
if (
|
|
1021
|
+
if (approvalInstance.comments && Array.isArray(approvalInstance.comments)) {
|
|
1025
1022
|
for (let comment of approvalInstance.comments) {
|
|
1026
1023
|
result.comments.push({
|
|
1027
1024
|
id: comment.id,
|