Skip to content

Commit

Permalink
perf: 采用模块重导的方式减少产生大量import语句
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoukaiyue committed Mar 26, 2024
1 parent 0279382 commit d5bc443
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/packages/request/cancel/utils/generateReqKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* @Author: zhoukai
* @Date: 2022-11-09 14:21:38
* @LastEditors: zhoukai
* @LastEditTime: 2022-12-09 10:46:50
* @LastEditTime: 2024-03-26 11:43:43
*/
import type { AxiosRequestConfigNew } from '../../type';
// 工具函数
import { isJson, isJsonStr } from '@/utils/validate';
import { isJson, isJsonStr } from '@/utils';

// QS 模块
import QS from 'qs';
Expand Down
7 changes: 3 additions & 4 deletions src/packages/request/retry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
* @LastEditTime: 2022-12-09 14:54:50
*/

// 工具函数之判断字符串是否是json字符串
import { isJsonStr } from '@/utils/validate';
// 睡眠函数
import { sleep } from '@/utils/sleep';
// 工具函数之判断字符串是否是json字符串,睡眠函数
import { isJsonStr, sleep } from '@/utils';

// axios 实例类型定义
import type { AxiosStatic } from 'axios';
// http错误状态码处理
Expand Down
15 changes: 15 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* @Descripttion:
* @version:
* @Author: zhoukai
* @Date: 2024-03-26 11:42:57
* @LastEditors: zhoukai
* @LastEditTime: 2024-03-26 11:43:02
*/
export * from './dayjs';
export * from './getCurrentUrlAssignKey';
export * from './handle-local';
export * from './handle-session';
export * from './regex-utils';
export * from './sleep';
export * from './validate';

0 comments on commit d5bc443

Please sign in to comment.