From 9c027fdcf5be48892fcc6e5e1ce8b78e3df4eb9c Mon Sep 17 00:00:00 2001 From: zhang Date: Mon, 22 Apr 2024 09:00:49 +0800 Subject: [PATCH] chore: format code (#3773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * first commit * style: 格式化代码 --- .env.analyze | 6 +++--- .env.development | 6 +++--- .env.docker | 6 +++--- .env.production | 6 +++--- .env.test | 8 ++++---- src/router/guard/index.ts | 3 ++- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.env.analyze b/.env.analyze index 1ff51cfc4..165728f10 100644 --- a/.env.analyze +++ b/.env.analyze @@ -11,13 +11,13 @@ VITE_BUILD_COMPRESS = 'none' # Basic interface address SPA -VITE_GLOB_API_URL=/basic-api +VITE_GLOB_API_URL = /basic-api # File upload address, optional # It can be forwarded by nginx or write the actual address directly -VITE_GLOB_UPLOAD_URL=/upload +VITE_GLOB_UPLOAD_URL = /upload # Interface prefix -VITE_GLOB_API_URL_PREFIX= +VITE_GLOB_API_URL_PREFIX = VITE_ENABLE_ANALYZE = true diff --git a/.env.development b/.env.development index ed7a6b20e..0daf23b26 100644 --- a/.env.development +++ b/.env.development @@ -5,10 +5,10 @@ VITE_USE_MOCK = true VITE_PUBLIC_PATH = / # Basic interface address SPA -VITE_GLOB_API_URL=/basic-api +VITE_GLOB_API_URL = /basic-api # File upload address, optional -VITE_GLOB_UPLOAD_URL=/upload +VITE_GLOB_UPLOAD_URL = /upload # Interface prefix -VITE_GLOB_API_URL_PREFIX= +VITE_GLOB_API_URL_PREFIX = diff --git a/.env.docker b/.env.docker index 2e4117be9..f7676e705 100644 --- a/.env.docker +++ b/.env.docker @@ -13,10 +13,10 @@ VITE_DROP_CONSOLE = true # Optional: gzip | brotli | none # If you need multiple forms, you can use `,` to separate VITE_BUILD_COMPRESS = 'none' -VITE_GLOB_API_URL="__vg_base_url" +VITE_GLOB_API_URL = "__vg_base_url" # File upload address, optional # It can be forwarded by nginx or write the actual address directly -VITE_GLOB_UPLOAD_URL=/files/upload +VITE_GLOB_UPLOAD_URL = /files/upload # Interface prefix -VITE_GLOB_API_URL_PREFIX= +VITE_GLOB_API_URL_PREFIX = diff --git a/.env.production b/.env.production index c672de621..c95d6ef9b 100644 --- a/.env.production +++ b/.env.production @@ -11,11 +11,11 @@ VITE_BUILD_COMPRESS = 'none' # Basic interface address SPA -VITE_GLOB_API_URL=/basic-api +VITE_GLOB_API_URL = /basic-api # File upload address, optional # It can be forwarded by nginx or write the actual address directly -VITE_GLOB_UPLOAD_URL=/upload +VITE_GLOB_UPLOAD_URL = /upload # Interface prefix -VITE_GLOB_API_URL_PREFIX= +VITE_GLOB_API_URL_PREFIX = diff --git a/.env.test b/.env.test index ea7e2e84a..f18e16ce9 100644 --- a/.env.test +++ b/.env.test @@ -1,4 +1,4 @@ -NODE_ENV=production +NODE_ENV = production # Whether to open mock VITE_USE_MOCK = true @@ -11,11 +11,11 @@ VITE_PUBLIC_PATH = / VITE_BUILD_COMPRESS = 'none' # Basic interface address SPA -VITE_GLOB_API_URL=/basic-api +VITE_GLOB_API_URL = /basic-api # File upload address, optional # It can be forwarded by nginx or write the actual address directly -VITE_GLOB_UPLOAD_URL=/upload +VITE_GLOB_UPLOAD_URL = /upload # Interface prefix -VITE_GLOB_API_URL_PREFIX= +VITE_GLOB_API_URL_PREFIX = diff --git a/src/router/guard/index.ts b/src/router/guard/index.ts index f643cc272..ee141ff1d 100644 --- a/src/router/guard/index.ts +++ b/src/router/guard/index.ts @@ -6,6 +6,7 @@ import { AxiosCanceler } from '@/utils/http/axios/axiosCancel'; import { Modal, notification } from 'ant-design-vue'; import { warn } from '@/utils/log'; import { unref } from 'vue'; +import { prefixCls } from '@/settings/designSetting'; import { setRouteChange } from '@/logics/mitt/routeChange'; import { createPermissionGuard } from './permissionGuard'; import { createStateGuard } from './stateGuard'; @@ -104,7 +105,7 @@ function createScrollGuard(router: Router) { router.afterEach(async (to) => { // scroll top isHash((to as RouteLocationNormalized & { href: string })?.href) && - document.querySelector('.vben-layout-content')?.scrollTo(0, 0); + document.querySelector(`.${prefixCls}-layout-content`)?.scrollTo(0, 0); return true; }); }