@kengic/uni 0.6.3-beta.25 → 0.6.3-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/service/http-client.ts +2 -2
- package/dist/util/kg.ts +9 -4
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ uni.addInterceptor('request', {
|
|
|
34
34
|
args.data = keys.map((i) => args.data[i]);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
args.data = Kg.parseParams(args.data);
|
|
37
|
+
args.data = Kg.parseParams(null, args.data);
|
|
38
38
|
},
|
|
39
39
|
success(args) {
|
|
40
40
|
uni.hideLoading();
|
|
@@ -248,7 +248,7 @@ const _httpClient: IHttpClient = {
|
|
|
248
248
|
$dayjs: options?.$dayjs,
|
|
249
249
|
dynamicQueryExcludeProperties: options?.dynamicQueryExcludeProperties,
|
|
250
250
|
dynamicQueryOperatorModel: options?.dynamicQueryOperatorModel,
|
|
251
|
-
params: Kg.parseParams(params),
|
|
251
|
+
params: Kg.parseParams(options?.$dayjs, params),
|
|
252
252
|
});
|
|
253
253
|
|
|
254
254
|
header = {
|
package/dist/util/kg.ts
CHANGED
|
@@ -36,9 +36,10 @@ export class Kg {
|
|
|
36
36
|
* </li>
|
|
37
37
|
* </ol>
|
|
38
38
|
*
|
|
39
|
+
* @param $dayjs.
|
|
39
40
|
* @param params 请求参数.
|
|
40
41
|
*/
|
|
41
|
-
public static parseParams(params?: Record<string, any> | null): any {
|
|
42
|
+
public static parseParams($dayjs: typeof dayjs | null | undefined, params?: Record<string, any> | null): any {
|
|
42
43
|
let _params = toRaw(unref(params))!;
|
|
43
44
|
|
|
44
45
|
if (!_params || !isObjectLike(_params)) {
|
|
@@ -52,8 +53,13 @@ export class Kg {
|
|
|
52
53
|
const value = _params[key];
|
|
53
54
|
|
|
54
55
|
switch (true) {
|
|
56
|
+
case !!$dayjs && isArray(value) && value.length === 2 && $dayjs.isDayjs(value[0]) && $dayjs.isDayjs(value[1]): {
|
|
57
|
+
resultParams[key] = value;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
case isObjectLike(value):
|
|
56
|
-
resultParams[key] = this.parseParams(value);
|
|
62
|
+
resultParams[key] = this.parseParams($dayjs, value);
|
|
57
63
|
break;
|
|
58
64
|
|
|
59
65
|
case typeof value === 'string':
|
|
@@ -303,8 +309,7 @@ export class Kg {
|
|
|
303
309
|
}
|
|
304
310
|
}
|
|
305
311
|
|
|
306
|
-
_paramsForQueryWhereSql[key] = _stringValue
|
|
307
|
-
|
|
312
|
+
_paramsForQueryWhereSql[key] = ` AND ${_stringValue}`;
|
|
308
313
|
break;
|
|
309
314
|
}
|
|
310
315
|
//endregion
|