@zwa73/utils 1.0.179 → 1.0.180
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/UtilCom.d.ts +1 -1
- package/dist/UtilCom.js +1 -1
- package/package.json +1 -1
- package/src/UtilCom.ts +2 -2
package/dist/UtilCom.d.ts
CHANGED
package/dist/UtilCom.js
CHANGED
|
@@ -88,7 +88,7 @@ var UtilCom;
|
|
|
88
88
|
const queryString = querystring_1.default.stringify(reqData);
|
|
89
89
|
if (queryString) {
|
|
90
90
|
// 检查当前路径是否已经包含问号
|
|
91
|
-
const separator = comReqOpt
|
|
91
|
+
const separator = comReqOpt?.path?.includes('?') ? '&' : '?';
|
|
92
92
|
comReqOpt.path += separator + queryString;
|
|
93
93
|
}
|
|
94
94
|
}
|
package/package.json
CHANGED
package/src/UtilCom.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type ComReqOpt = {
|
|
|
25
25
|
/**请求域名 */
|
|
26
26
|
hostname: string;
|
|
27
27
|
/**请求路径 */
|
|
28
|
-
path
|
|
28
|
+
path?: string;
|
|
29
29
|
/**请求方式 post 为 */
|
|
30
30
|
method: 'POST'|'GET';
|
|
31
31
|
/**端口 */
|
|
@@ -147,7 +147,7 @@ async function jsonReq<T extends ComReqOpt>(
|
|
|
147
147
|
const queryString = qs.stringify(reqData as GetReqData);
|
|
148
148
|
if (queryString) {
|
|
149
149
|
// 检查当前路径是否已经包含问号
|
|
150
|
-
const separator = comReqOpt
|
|
150
|
+
const separator = comReqOpt?.path?.includes('?') ? '&' : '?';
|
|
151
151
|
comReqOpt.path += separator + queryString;
|
|
152
152
|
}
|
|
153
153
|
}
|