Browse Source

chore: format code (#3773)

* first commit

* style: 格式化代码
zhang 11 months ago
parent
commit
9c027fdcf5
6 changed files with 18 additions and 17 deletions
  1. 3 3
      .env.analyze
  2. 3 3
      .env.development
  3. 3 3
      .env.docker
  4. 3 3
      .env.production
  5. 4 4
      .env.test
  6. 2 1
      src/router/guard/index.ts

+ 3 - 3
.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

+ 3 - 3
.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 =

+ 3 - 3
.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 =

+ 3 - 3
.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 =

+ 4 - 4
.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 =

+ 2 - 1
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;
   });
 }