diff --git a/.prettierrc.js b/.prettierrc.js index d6a07a8..ad768ba 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -14,7 +14,7 @@ export default { // 在 JSX 中使用单引号替代双引号,默认false jsxSingleQuote: false, // 每行最多字符数量,超出换行(默认100) - printWidth: 120, + printWidth: 160, // 超出打印宽度 (always | never | preserve ) proseWrap: 'preserve', // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;) diff --git a/src/api/service/mockRequest.ts b/src/api/service/mockRequest.ts index 1bfe5ec..8c45a71 100644 --- a/src/api/service/mockRequest.ts +++ b/src/api/service/mockRequest.ts @@ -31,12 +31,7 @@ class PureHttp { } /** 通用请求工具函数 */ - public request( - method: RequestMethods, - url: string, - param?: AxiosRequestConfig, - axiosConfig?: PureHttpRequestConfig - ): Promise { + public request(method: RequestMethods, url: string, param?: AxiosRequestConfig, axiosConfig?: PureHttpRequestConfig): Promise { const config = { method, url, diff --git a/src/api/service/request.ts b/src/api/service/request.ts index 4e3e97d..cea6241 100644 --- a/src/api/service/request.ts +++ b/src/api/service/request.ts @@ -33,12 +33,7 @@ class PureHttp { } /** 通用请求工具函数 */ - public request( - method: RequestMethods, - url: string, - param?: AxiosRequestConfig, - axiosConfig?: PureHttpRequestConfig - ): Promise { + public request(method: RequestMethods, url: string, param?: AxiosRequestConfig, axiosConfig?: PureHttpRequestConfig): Promise { const config = { method, url, ...param, ...axiosConfig } as PureHttpRequestConfig; // 单独处理自定义请求/响应回调 diff --git a/src/api/service/types.d.ts b/src/api/service/types.d.ts index 5841f5e..5f3ddd9 100644 --- a/src/api/service/types.d.ts +++ b/src/api/service/types.d.ts @@ -38,12 +38,7 @@ export interface PureHttpRequestConfig extends AxiosRequestConfig { } export default class PureHttp { - request( - method: RequestMethods, - url: string, - param?: AxiosRequestConfig, - axiosConfig?: PureHttpRequestConfig - ): Promise; + request(method: RequestMethods, url: string, param?: AxiosRequestConfig, axiosConfig?: PureHttpRequestConfig): Promise; post(url: string, params?: P, config?: PureHttpRequestConfig): Promise; diff --git a/src/api/v1/files.ts b/src/api/v1/files.ts index 06317fd..bcd99b5 100644 --- a/src/api/v1/files.ts +++ b/src/api/v1/files.ts @@ -9,22 +9,12 @@ export const getFilesPage = (data: any) => { }; /** 系统文件管理---添加系统文件 */ export const fetchAddFiles = (data: any) => { - return http.request>( - 'post', - 'files', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('post', 'files', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; /** 系统文件管理---更新系统文件 */ export const updateFiles = (data: any) => { - return http.request>( - 'put', - 'files', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('put', 'files', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; /** 系统文件管理---删除系统文件 */ diff --git a/src/api/v1/i18n.ts b/src/api/v1/i18n.ts index 2aa6765..12085aa 100644 --- a/src/api/v1/i18n.ts +++ b/src/api/v1/i18n.ts @@ -35,12 +35,7 @@ export const downloadI18n = (params: object) => { /** 多语言管理---文件更新多语言可以是JSON、Excel */ export const uploadI18nFile = (data: any) => { - return http.request>( - 'put', - 'i18n/file', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('put', 'i18n/file', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; // ------------------------------------------------ diff --git a/src/api/v1/system/adminUser.ts b/src/api/v1/system/adminUser.ts index 3d98077..5888856 100644 --- a/src/api/v1/system/adminUser.ts +++ b/src/api/v1/system/adminUser.ts @@ -47,12 +47,7 @@ export const createUserByAdmin = (data: any) => { /** 用户信息---更新用户信息 */ export const updateUserByAdmin = (data: any) => { - return http.request>( - 'put', - 'user', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('put', 'user', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; /** 用户信息---删除用户信息 */ @@ -91,12 +86,7 @@ export const refreshTokenApi = (data?: object) => { /** 发送邮件 */ export const sendLoginEmail = (data: any) => { - return http.request>( - 'post', - '/user/public/sendLoginEmail', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('post', '/user/public/sendLoginEmail', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; /** 获取用户信息,根据当前token获取 */ @@ -116,10 +106,5 @@ export const updateUserinfo = (data: any) => { /** 用户信息---更新用户密码 */ export const updateUserPassword = (data: any) => { - return http.request>( - 'put', - 'user/private/update/password', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('put', 'user/private/update/password', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; diff --git a/src/api/v1/system/power.ts b/src/api/v1/system/power.ts index 9d37319..fd20b39 100644 --- a/src/api/v1/system/power.ts +++ b/src/api/v1/system/power.ts @@ -30,12 +30,7 @@ export const exportPermission = () => { /** 权限---导入权限权限 */ export const importPermission = (data: any) => { - return http.request( - 'put', - 'permission/file/import', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request('put', 'permission/file/import', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; /** 权限---获取所有权限 */ diff --git a/src/api/v1/system/role.ts b/src/api/v1/system/role.ts index 8fe8683..25accd7 100644 --- a/src/api/v1/system/role.ts +++ b/src/api/v1/system/role.ts @@ -34,12 +34,7 @@ export const exportRoleList = () => { /* 角色---使用Excel更新角色列表 */ export const updateRoleByFile = (data: any) => { - return http.request>( - 'put', - `/role/file/import`, - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('put', `/role/file/import`, { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; /** 为用户分配角色---根据用户id获取所有角色 */ diff --git a/src/api/v1/system/system.ts b/src/api/v1/system/system.ts index dc6baaf..f4b5808 100644 --- a/src/api/v1/system/system.ts +++ b/src/api/v1/system/system.ts @@ -8,10 +8,5 @@ export const fetchRouterAsync = () => { /** 上传文件 */ export const uploadFile = (data: any) => { - return http.request>( - 'post', - '/files/private/upload', - { data }, - { headers: { 'Content-Type': 'multipart/form-data' } } - ); + return http.request>('post', '/files/private/upload', { data }, { headers: { 'Content-Type': 'multipart/form-data' } }); }; diff --git a/src/assets/iconfont/iconfont.js b/src/assets/iconfont/iconfont.js index 6499a73..08fdd81 100644 --- a/src/assets/iconfont/iconfont.js +++ b/src/assets/iconfont/iconfont.js @@ -16,9 +16,7 @@ if (c && !e.__iconfont__svg__cssinject__) { e.__iconfont__svg__cssinject__ = !0; try { - document.write( - '' - ); + document.write(''); } catch (t) { console && console.log(t); } diff --git a/src/components/CountTo/src/normal/index.tsx b/src/components/CountTo/src/normal/index.tsx index fc90892..8aaad90 100644 --- a/src/components/CountTo/src/normal/index.tsx +++ b/src/components/CountTo/src/normal/index.tsx @@ -54,7 +54,6 @@ export default defineComponent({ state.rAF = requestAnimationFrame(count); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars function pauseResume() { if (state.paused) { resume(); @@ -76,7 +75,6 @@ export default defineComponent({ requestAnimationFrame(count); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars function reset() { state.startTime = null; cancelAnimationFrame(state.rAF); @@ -91,23 +89,15 @@ export default defineComponent({ state.remaining = (state.localDuration as number) - progress; if (useEasing) { if (unref(getCountDown)) { - state.printVal = - state.localStartVal - easingFn(progress, 0, state.localStartVal - endVal, state.localDuration as number); + state.printVal = state.localStartVal - easingFn(progress, 0, state.localStartVal - endVal, state.localDuration as number); } else { - state.printVal = easingFn( - progress, - state.localStartVal, - endVal - state.localStartVal, - state.localDuration as number - ); + state.printVal = easingFn(progress, state.localStartVal, endVal - state.localStartVal, state.localDuration as number); } } else { if (unref(getCountDown)) { - state.printVal = - state.localStartVal - (state.localStartVal - endVal) * (progress / (state.localDuration as number)); + state.printVal = state.localStartVal - (state.localStartVal - endVal) * (progress / (state.localDuration as number)); } else { - state.printVal = - state.localStartVal + (endVal - state.localStartVal) * (progress / (state.localDuration as number)); + state.printVal = state.localStartVal + (endVal - state.localStartVal) * (progress / (state.localDuration as number)); } } if (unref(getCountDown)) { diff --git a/src/components/CropperPreview/src/index.vue b/src/components/CropperPreview/src/index.vue index cd94d10..ab222f4 100644 --- a/src/components/CropperPreview/src/index.vue +++ b/src/components/CropperPreview/src/index.vue @@ -39,13 +39,7 @@ defineExpose({ hidePopover });
- +

{{ $t('image_size') }}:{{ parseInt(infos.width) }} × {{ parseInt(infos.height) }}{{ $t('pixel') }}

{{ $t('file_size') }}:{{ formatBytes(infos.size) }}({{ infos.size }} {{ $t('bytes') }}

diff --git a/src/components/Error/403.vue b/src/components/Error/403.vue index da8c9d3..25cc30e 100644 --- a/src/components/Error/403.vue +++ b/src/components/Error/403.vue @@ -14,29 +14,13 @@ const router = useRouter();
-

+

403

-

+

{{ $t('sorryNoAccess') }}

- + {{ $t('returnToHomepage') }}
diff --git a/src/components/Error/404.vue b/src/components/Error/404.vue index 79510ed..1739c7d 100644 --- a/src/components/Error/404.vue +++ b/src/components/Error/404.vue @@ -14,20 +14,10 @@ const router = useRouter();
-

+

404

-

+

{{ $t('sorryPageNotFound') }}

-

+

500

-

+

{{ $t('sorryServerError') }}

- + {{ $t('returnToHomepage') }}
diff --git a/src/components/ReAnimateSelector/src/index.vue b/src/components/ReAnimateSelector/src/index.vue index 1aec639..3a40c83 100644 --- a/src/components/ReAnimateSelector/src/index.vue +++ b/src/components/ReAnimateSelector/src/index.vue @@ -101,20 +101,12 @@ function onMouseleave() { @mouseenter.prevent="onMouseEnter(index)" @mouseleave.prevent="onMouseleave" > -

+

{{ animate }}

- +
diff --git a/src/components/ReCropper/src/index.tsx b/src/components/ReCropper/src/index.tsx index 5a082ac..a8e368f 100644 --- a/src/components/ReCropper/src/index.tsx +++ b/src/components/ReCropper/src/index.tsx @@ -101,15 +101,7 @@ export default defineComponent({ }); const iconClass = computed(() => { - return [ - 'p-[6px]', - 'h-[30px]', - 'w-[30px]', - 'outline-none', - 'rounded-[4px]', - 'cursor-pointer', - 'hover:bg-[rgba(0,0,0,0.06)]', - ]; + return ['p-[6px]', 'h-[30px]', 'w-[30px]', 'outline-none', 'rounded-[4px]', 'cursor-pointer', 'hover:bg-[rgba(0,0,0,0.06)]']; }); const getWrapperStyle = computed((): CSSProperties => { @@ -249,11 +241,7 @@ export default defineComponent({ realTimeCroppered(); }} /> - handCropper('reset')} - /> + handCropper('reset')} /> handCropper('move', [10, 0]), '0:100']} /> - handCropper('scaleX', -1)} - /> - handCropper('scaleY', -1)} - /> - handCropper('rotate', -45)} - /> - handCropper('rotate', 45)} - /> + handCropper('scaleX', -1)} /> + handCropper('scaleY', -1)} /> + handCropper('rotate', -45)} /> + handCropper('rotate', 45)} /> - +
- +