@kengic/uni 0.6.3-beta.25 → 0.6.3-beta.26

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.
@@ -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':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.6.3-beta.25",
3
+ "version": "0.6.3-beta.26",
4
4
  "scripts": {
5
5
  "build": "npm run use-node && rimraf dist && vue-tsc && vite build",
6
6
  "------ -------------------------------------------": "",