Browse Source

release: update `3.6.4`

i18n
xiaoxian521 2 years ago
parent
commit
12973dcf5b
  1. 6
      .env.development
  2. 3
      .env.production
  3. 7
      .env.staging
  4. 9
      build/index.ts
  5. 14
      package.json
  6. 98
      pnpm-lock.yaml
  7. 2
      src/api/routes.ts
  8. 2
      src/api/user.ts
  9. 4
      src/style/sidebar.scss
  10. 11
      src/utils/http/index.ts
  11. 2
      src/views/login/index.vue
  12. 2
      src/views/permission/page/index.vue
  13. 2
      types/global.d.ts
  14. 20
      vite.config.ts

6
.env.development

@ -4,11 +4,5 @@ VITE_PORT = 8848
# 开发环境读取配置文件路径 # 开发环境读取配置文件路径
VITE_PUBLIC_PATH = / VITE_PUBLIC_PATH = /
# 开发环境代理
VITE_PROXY_DOMAIN = /api
# 开发环境路由历史模式 # 开发环境路由历史模式
VITE_ROUTER_HISTORY = "hash" VITE_ROUTER_HISTORY = "hash"
# 开发环境后端地址
VITE_PROXY_DOMAIN_REAL = "http://127.0.0.1:3000"

3
.env.production

@ -4,9 +4,6 @@ VITE_PUBLIC_PATH = /
# 线上环境路由历史模式 # 线上环境路由历史模式
VITE_ROUTER_HISTORY = "hash" VITE_ROUTER_HISTORY = "hash"
# 线上环境后端地址
VITE_PROXY_DOMAIN_REAL = ""
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false # 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
VITE_LEGACY = false VITE_LEGACY = false

7
.env.staging

@ -7,16 +7,13 @@ VITE_PUBLIC_PATH = /
# 线上环境路由历史模式 # 线上环境路由历史模式
VITE_ROUTER_HISTORY = "hash" VITE_ROUTER_HISTORY = "hash"
# 线上环境后端地址
VITE_PROXY_DOMAIN_REAL = ""
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false # 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
VITE_LEGACY = false VITE_LEGACY = false
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false # 是否在打包时使用cdn替换本地库 替换 true 不替换 false
VITE_CDN = false
VITE_CDN = true
# 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件) # 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件)
# 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) # 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
# 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) # 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
VITE_COMPRESSION = "none"
VITE_COMPRESSION = "both-clear"

9
build/index.ts

@ -4,8 +4,6 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
const ret: ViteEnv = { const ret: ViteEnv = {
VITE_PORT: 8848, VITE_PORT: 8848,
VITE_PUBLIC_PATH: "", VITE_PUBLIC_PATH: "",
VITE_PROXY_DOMAIN: "",
VITE_PROXY_DOMAIN_REAL: "",
VITE_ROUTER_HISTORY: "", VITE_ROUTER_HISTORY: "",
VITE_LEGACY: false, VITE_LEGACY: false,
VITE_CDN: false, VITE_CDN: false,
@ -30,14 +28,9 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
return ret; return ret;
}; };
/** 跨域代理重写 */
const regExps = (value: string, reg: string): string => {
return value.replace(new RegExp(`^${reg}`, "g"), "");
};
/** 环境变量 */ /** 环境变量 */
const loadEnv = (): ViteEnv => { const loadEnv = (): ViteEnv => {
return import.meta.env; return import.meta.env;
}; };
export { warpperEnv, regExps, loadEnv };
export { warpperEnv, loadEnv };

14
package.json

@ -85,9 +85,9 @@
"@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^10.0.0", "@vue/eslint-config-typescript": "^10.0.0",
"@vue/runtime-core": "^3.2.40", "@vue/runtime-core": "^3.2.40",
"autoprefixer": "^10.4.12",
"autoprefixer": "^10.4.13",
"cloc": "^2.10.0", "cloc": "^2.10.0",
"cssnano": "^5.1.13",
"cssnano": "^5.1.14",
"eslint": "^8.8.0", "eslint": "^8.8.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.4.1", "eslint-plugin-vue": "^8.4.1",
@ -95,14 +95,14 @@
"husky": "^7.0.4", "husky": "^7.0.4",
"lint-staged": "11.1.2", "lint-staged": "11.1.2",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"postcss": "^8.4.17",
"postcss": "^8.4.18",
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-import": "^15.0.0", "postcss-import": "^15.0.0",
"postcss-scss": "^4.0.5", "postcss-scss": "^4.0.5",
"prettier": "^2.5.1", "prettier": "^2.5.1",
"pretty-quick": "3.1.1", "pretty-quick": "3.1.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup-plugin-visualizer": "^5.8.2",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.53.0", "sass": "^1.53.0",
"sass-loader": "^13.0.2", "sass-loader": "^13.0.2",
"stylelint": "^14.3.0", "stylelint": "^14.3.0",
@ -111,15 +111,15 @@
"stylelint-config-recommended": "^6.0.0", "stylelint-config-recommended": "^6.0.0",
"stylelint-config-standard": "^24.0.0", "stylelint-config-standard": "^24.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"tailwindcss": "^3.2.1",
"terser": "^5.15.0",
"tailwindcss": "^3.2.3",
"terser": "^5.15.1",
"typescript": "^4.7.4", "typescript": "^4.7.4",
"unplugin-vue-define-options": "0.7.3", "unplugin-vue-define-options": "0.7.3",
"vite": "^3.1.8", "vite": "^3.1.8",
"vite-plugin-cdn-import": "^0.3.5", "vite-plugin-cdn-import": "^0.3.5",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^1.1.0",
"vite-plugin-remove-console": "^1.2.0",
"vite-svg-loader": "^3.6.0", "vite-svg-loader": "^3.6.0",
"vue-eslint-parser": "^8.2.0", "vue-eslint-parser": "^8.2.0",
"vue-tsc": "^0.40.13" "vue-tsc": "^0.40.13"

98
pnpm-lock.yaml

@ -33,10 +33,10 @@ specifiers:
"@vueuse/motion": ^2.0.0-beta.12 "@vueuse/motion": ^2.0.0-beta.12
"@vueuse/shared": ^9.4.0 "@vueuse/shared": ^9.4.0
animate.css: ^4.1.1 animate.css: ^4.1.1
autoprefixer: ^10.4.12
autoprefixer: ^10.4.13
axios: ^1.1.3 axios: ^1.1.3
cloc: ^2.10.0 cloc: ^2.10.0
cssnano: ^5.1.13
cssnano: ^5.1.14
dayjs: ^1.11.4 dayjs: ^1.11.4
echarts: ^5.3.3 echarts: ^5.3.3
element-plus: ^2.2.16 element-plus: ^2.2.16
@ -57,7 +57,7 @@ specifiers:
path: ^0.12.7 path: ^0.12.7
picocolors: ^1.0.0 picocolors: ^1.0.0
pinia: ^2.0.21 pinia: ^2.0.21
postcss: ^8.4.17
postcss: ^8.4.18
postcss-html: ^1.5.0 postcss-html: ^1.5.0
postcss-import: ^15.0.0 postcss-import: ^15.0.0
postcss-scss: ^4.0.5 postcss-scss: ^4.0.5
@ -67,7 +67,7 @@ specifiers:
resize-observer-polyfill: ^1.5.1 resize-observer-polyfill: ^1.5.1
responsive-storage: ^2.1.0 responsive-storage: ^2.1.0
rimraf: 3.0.2 rimraf: 3.0.2
rollup-plugin-visualizer: ^5.8.2
rollup-plugin-visualizer: ^5.8.3
sass: ^1.53.0 sass: ^1.53.0
sass-loader: ^13.0.2 sass-loader: ^13.0.2
stylelint: ^14.3.0 stylelint: ^14.3.0
@ -76,15 +76,15 @@ specifiers:
stylelint-config-recommended: ^6.0.0 stylelint-config-recommended: ^6.0.0
stylelint-config-standard: ^24.0.0 stylelint-config-standard: ^24.0.0
stylelint-order: ^5.0.0 stylelint-order: ^5.0.0
tailwindcss: ^3.2.1
terser: ^5.15.0
tailwindcss: ^3.2.3
terser: ^5.15.1
typescript: ^4.7.4 typescript: ^4.7.4
unplugin-vue-define-options: 0.7.3 unplugin-vue-define-options: 0.7.3
vite: ^3.1.8 vite: ^3.1.8
vite-plugin-cdn-import: ^0.3.5 vite-plugin-cdn-import: ^0.3.5
vite-plugin-compression: ^0.5.1 vite-plugin-compression: ^0.5.1
vite-plugin-mock: ^2.9.6 vite-plugin-mock: ^2.9.6
vite-plugin-remove-console: ^1.1.0
vite-plugin-remove-console: ^1.2.0
vite-svg-loader: ^3.6.0 vite-svg-loader: ^3.6.0
vue: ^3.2.40 vue: ^3.2.40
vue-eslint-parser: ^8.2.0 vue-eslint-parser: ^8.2.0
@ -153,9 +153,9 @@ devDependencies:
"@vue/eslint-config-prettier": 7.0.0_eslint@8.25.0+prettier@2.7.1 "@vue/eslint-config-prettier": 7.0.0_eslint@8.25.0+prettier@2.7.1
"@vue/eslint-config-typescript": 10.0.0_07d3deb2283d82fbf0376bf257049d49 "@vue/eslint-config-typescript": 10.0.0_07d3deb2283d82fbf0376bf257049d49
"@vue/runtime-core": 3.2.41 "@vue/runtime-core": 3.2.41
autoprefixer: 10.4.12_postcss@8.4.18
autoprefixer: 10.4.13_postcss@8.4.18
cloc: 2.10.0 cloc: 2.10.0
cssnano: 5.1.13_postcss@8.4.18
cssnano: 5.1.14_postcss@8.4.18
eslint: 8.25.0 eslint: 8.25.0
eslint-plugin-prettier: 4.2.1_eslint@8.25.0+prettier@2.7.1 eslint-plugin-prettier: 4.2.1_eslint@8.25.0+prettier@2.7.1
eslint-plugin-vue: 8.7.1_eslint@8.25.0 eslint-plugin-vue: 8.7.1_eslint@8.25.0
@ -179,7 +179,7 @@ devDependencies:
stylelint-config-recommended: 6.0.0_stylelint@14.14.0 stylelint-config-recommended: 6.0.0_stylelint@14.14.0
stylelint-config-standard: 24.0.0_stylelint@14.14.0 stylelint-config-standard: 24.0.0_stylelint@14.14.0
stylelint-order: 5.0.0_stylelint@14.14.0 stylelint-order: 5.0.0_stylelint@14.14.0
tailwindcss: 3.2.1
tailwindcss: 3.2.3
terser: 5.15.1 terser: 5.15.1
typescript: 4.8.4 typescript: 4.8.4
unplugin-vue-define-options: 0.7.3_vite@3.1.8+vue@3.2.41 unplugin-vue-define-options: 0.7.3_vite@3.1.8+vue@3.2.41
@ -187,7 +187,7 @@ devDependencies:
vite-plugin-cdn-import: 0.3.5 vite-plugin-cdn-import: 0.3.5
vite-plugin-compression: 0.5.1_vite@3.1.8 vite-plugin-compression: 0.5.1_vite@3.1.8
vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@3.1.8 vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@3.1.8
vite-plugin-remove-console: 1.1.0
vite-plugin-remove-console: 1.2.0
vite-svg-loader: 3.6.0 vite-svg-loader: 3.6.0
vue-eslint-parser: 8.3.0_eslint@8.25.0 vue-eslint-parser: 8.3.0_eslint@8.25.0
vue-tsc: 0.40.13_typescript@4.8.4 vue-tsc: 0.40.13_typescript@4.8.4
@ -2041,7 +2041,7 @@ packages:
dependencies: dependencies:
cac: 6.7.14 cac: 6.7.14
color: 4.2.3 color: 4.2.3
cssnano: 5.1.13_postcss@8.4.18
cssnano: 5.1.14_postcss@8.4.18
cssnano-preset-lite: 2.1.3_postcss@8.4.18 cssnano-preset-lite: 2.1.3_postcss@8.4.18
fs-extra: 10.1.0 fs-extra: 10.1.0
postcss: 8.4.18 postcss: 8.4.18
@ -2300,10 +2300,10 @@ packages:
} }
dev: false dev: false
/autoprefixer/10.4.12_postcss@8.4.18:
/autoprefixer/10.4.13_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-WrCGV9/b97Pa+jtwf5UGaRjgQIg7OK3D06GnoYoZNcG1Xb8Gt3EfuKjlhh9i/VtT16g6PYjZ69jdJ2g8FxSC4Q==
integrity: sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==
} }
engines: { node: ^10 || ^12 || >=14 } engines: { node: ^10 || ^12 || >=14 }
hasBin: true hasBin: true
@ -2311,7 +2311,7 @@ packages:
postcss: ^8.1.0 postcss: ^8.1.0
dependencies: dependencies:
browserslist: 4.21.4 browserslist: 4.21.4
caniuse-lite: 1.0.30001422
caniuse-lite: 1.0.30001431
fraction.js: 4.2.0 fraction.js: 4.2.0
normalize-range: 0.1.2 normalize-range: 0.1.2
picocolors: 1.0.0 picocolors: 1.0.0
@ -2393,7 +2393,7 @@ packages:
engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 }
hasBin: true hasBin: true
dependencies: dependencies:
caniuse-lite: 1.0.30001422
caniuse-lite: 1.0.30001431
electron-to-chromium: 1.4.284 electron-to-chromium: 1.4.284
node-releases: 2.0.6 node-releases: 2.0.6
update-browserslist-db: 1.0.10_browserslist@4.21.4 update-browserslist-db: 1.0.10_browserslist@4.21.4
@ -2483,15 +2483,15 @@ packages:
} }
dependencies: dependencies:
browserslist: 4.21.4 browserslist: 4.21.4
caniuse-lite: 1.0.30001422
caniuse-lite: 1.0.30001431
lodash.memoize: 4.1.2 lodash.memoize: 4.1.2
lodash.uniq: 4.5.0 lodash.uniq: 4.5.0
dev: true dev: true
/caniuse-lite/1.0.30001422:
/caniuse-lite/1.0.30001431:
resolution: resolution:
{ {
integrity: sha512-hSesn02u1QacQHhaxl/kNMZwqVG35Sz/8DgvmgedxSH8z9UUpcDYSPYgsj3x5dQNRcNp6BwpSfQfVzYUTm+fog==
integrity: sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==
} }
dev: true dev: true
@ -2874,10 +2874,10 @@ packages:
hasBin: true hasBin: true
dev: true dev: true
/cssnano-preset-default/5.2.12_postcss@8.4.18:
/cssnano-preset-default/5.2.13_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-OyCBTZi+PXgylz9HAA5kHyoYhfGcYdwFmyaJzWnzxuGRtnMw/kR6ilW9XzlzlRAtB6PLT/r+prYgkef7hngFew==
integrity: sha512-PX7sQ4Pb+UtOWuz8A1d+Rbi+WimBIxJTRyBdgGp1J75VU0r/HFQeLnMYgHiCAp6AR4rqrc7Y4R+1Rjk3KJz6DQ==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -2888,16 +2888,16 @@ packages:
postcss: 8.4.18 postcss: 8.4.18
postcss-calc: 8.2.4_postcss@8.4.18 postcss-calc: 8.2.4_postcss@8.4.18
postcss-colormin: 5.3.0_postcss@8.4.18 postcss-colormin: 5.3.0_postcss@8.4.18
postcss-convert-values: 5.1.2_postcss@8.4.18
postcss-convert-values: 5.1.3_postcss@8.4.18
postcss-discard-comments: 5.1.2_postcss@8.4.18 postcss-discard-comments: 5.1.2_postcss@8.4.18
postcss-discard-duplicates: 5.1.0_postcss@8.4.18 postcss-discard-duplicates: 5.1.0_postcss@8.4.18
postcss-discard-empty: 5.1.1_postcss@8.4.18 postcss-discard-empty: 5.1.1_postcss@8.4.18
postcss-discard-overridden: 5.1.0_postcss@8.4.18 postcss-discard-overridden: 5.1.0_postcss@8.4.18
postcss-merge-longhand: 5.1.6_postcss@8.4.18
postcss-merge-rules: 5.1.2_postcss@8.4.18
postcss-merge-longhand: 5.1.7_postcss@8.4.18
postcss-merge-rules: 5.1.3_postcss@8.4.18
postcss-minify-font-values: 5.1.0_postcss@8.4.18 postcss-minify-font-values: 5.1.0_postcss@8.4.18
postcss-minify-gradients: 5.1.1_postcss@8.4.18 postcss-minify-gradients: 5.1.1_postcss@8.4.18
postcss-minify-params: 5.1.3_postcss@8.4.18
postcss-minify-params: 5.1.4_postcss@8.4.18
postcss-minify-selectors: 5.2.1_postcss@8.4.18 postcss-minify-selectors: 5.2.1_postcss@8.4.18
postcss-normalize-charset: 5.1.0_postcss@8.4.18 postcss-normalize-charset: 5.1.0_postcss@8.4.18
postcss-normalize-display-values: 5.1.0_postcss@8.4.18 postcss-normalize-display-values: 5.1.0_postcss@8.4.18
@ -2905,11 +2905,11 @@ packages:
postcss-normalize-repeat-style: 5.1.1_postcss@8.4.18 postcss-normalize-repeat-style: 5.1.1_postcss@8.4.18
postcss-normalize-string: 5.1.0_postcss@8.4.18 postcss-normalize-string: 5.1.0_postcss@8.4.18
postcss-normalize-timing-functions: 5.1.0_postcss@8.4.18 postcss-normalize-timing-functions: 5.1.0_postcss@8.4.18
postcss-normalize-unicode: 5.1.0_postcss@8.4.18
postcss-normalize-unicode: 5.1.1_postcss@8.4.18
postcss-normalize-url: 5.1.0_postcss@8.4.18 postcss-normalize-url: 5.1.0_postcss@8.4.18
postcss-normalize-whitespace: 5.1.1_postcss@8.4.18 postcss-normalize-whitespace: 5.1.1_postcss@8.4.18
postcss-ordered-values: 5.1.3_postcss@8.4.18 postcss-ordered-values: 5.1.3_postcss@8.4.18
postcss-reduce-initial: 5.1.0_postcss@8.4.18
postcss-reduce-initial: 5.1.1_postcss@8.4.18
postcss-reduce-transforms: 5.1.0_postcss@8.4.18 postcss-reduce-transforms: 5.1.0_postcss@8.4.18
postcss-svgo: 5.1.0_postcss@8.4.18 postcss-svgo: 5.1.0_postcss@8.4.18
postcss-unique-selectors: 5.1.1_postcss@8.4.18 postcss-unique-selectors: 5.1.1_postcss@8.4.18
@ -2943,16 +2943,16 @@ packages:
postcss: 8.4.18 postcss: 8.4.18
dev: true dev: true
/cssnano/5.1.13_postcss@8.4.18:
/cssnano/5.1.14_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-S2SL2ekdEz6w6a2epXn4CmMKU4K3KpcyXLKfAYc9UQQqJRkD/2eLUG0vJ3Db/9OvO5GuAdgXw3pFbR6abqghDQ==
integrity: sha512-Oou7ihiTocbKqi0J1bB+TRJIQX5RMR3JghA8hcWSw9mjBLQ5Y3RWqEDoYG3sRNlAbCIXpqMoZGbq5KDR3vdzgw==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
postcss: ^8.2.15 postcss: ^8.2.15
dependencies: dependencies:
cssnano-preset-default: 5.2.12_postcss@8.4.18
cssnano-preset-default: 5.2.13_postcss@8.4.18
lilconfig: 2.0.6 lilconfig: 2.0.6
postcss: 8.4.18 postcss: 8.4.18
yaml: 1.10.2 yaml: 1.10.2
@ -5730,10 +5730,10 @@ packages:
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
dev: true dev: true
/postcss-convert-values/5.1.2_postcss@8.4.18:
/postcss-convert-values/5.1.3_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-c6Hzc4GAv95B7suy4udszX9Zy4ETyMCgFPUDtWjdFTKH1SE9eFY/jEpHSwTH1QPuwxHpWslhckUQWbNRM4ho5g==
integrity: sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -5875,10 +5875,10 @@ packages:
} }
dev: true dev: true
/postcss-merge-longhand/5.1.6_postcss@8.4.18:
/postcss-merge-longhand/5.1.7_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-6C/UGF/3T5OE2CEbOuX7iNO63dnvqhGZeUnKkDeifebY0XqkkvrctYSZurpNE902LDf2yKwwPFgotnfSoPhQiw==
integrity: sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -5886,13 +5886,13 @@ packages:
dependencies: dependencies:
postcss: 8.4.18 postcss: 8.4.18
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
stylehacks: 5.1.0_postcss@8.4.18
stylehacks: 5.1.1_postcss@8.4.18
dev: true dev: true
/postcss-merge-rules/5.1.2_postcss@8.4.18:
/postcss-merge-rules/5.1.3_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-zKMUlnw+zYCWoPN6yhPjtcEdlJaMUZ0WyVcxTAmw3lkkN/NDMRkOkiuctQEoWAOvH7twaxUUdvBWl0d4+hifRQ==
integrity: sha512-LbLd7uFC00vpOuMvyZop8+vvhnfRGpp2S+IMQKeuOZZapPRY4SMq5ErjQeHbHsjCUgJkRNrlU+LmxsKIqPKQlA==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -5933,10 +5933,10 @@ packages:
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
dev: true dev: true
/postcss-minify-params/5.1.3_postcss@8.4.18:
/postcss-minify-params/5.1.4_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-bkzpWcjykkqIujNL+EVEPOlLYi/eZ050oImVtHU7b4lFS82jPnsCb44gvC6pxaNt38Els3jWYDHTjHKf0koTgg==
integrity: sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -6051,10 +6051,10 @@ packages:
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
dev: true dev: true
/postcss-normalize-unicode/5.1.0_postcss@8.4.18:
/postcss-normalize-unicode/5.1.1_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-J6M3MizAAZ2dOdSjy2caayJLQT8E8K9XjLce8AUQMwOrCvjCHv24aLC/Lps1R1ylOfol5VIDMaM/Lo9NGlk1SQ==
integrity: sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -6106,10 +6106,10 @@ packages:
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
dev: true dev: true
/postcss-reduce-initial/5.1.0_postcss@8.4.18:
/postcss-reduce-initial/5.1.1_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-5OgTUviz0aeH6MtBjHfbr57tml13PuedK/Ecg8szzd4XRMbYxH4572JFG067z+FqBIf6Zp/d+0581glkvvWMFw==
integrity: sha512-//jeDqWcHPuXGZLoolFrUXBDyuEGbr9S2rMo19bkTIjBQ4PqkaO+oI8wua5BOUxpfi97i3PCoInsiFIEBfkm9w==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -6970,10 +6970,10 @@ packages:
tslib: 2.4.0 tslib: 2.4.0
dev: false dev: false
/stylehacks/5.1.0_postcss@8.4.18:
/stylehacks/5.1.1_postcss@8.4.18:
resolution: resolution:
{ {
integrity: sha512-SzLmvHQTrIWfSgljkQCw2++C9+Ne91d/6Sp92I8c5uHTcy/PgeHamwITIbBW9wnFTY/3ZfSXR9HIL6Ikqmcu6Q==
integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==
} }
engines: { node: ^10 || ^12 || >=14.0 } engines: { node: ^10 || ^12 || >=14.0 }
peerDependencies: peerDependencies:
@ -7181,10 +7181,10 @@ packages:
strip-ansi: 6.0.1 strip-ansi: 6.0.1
dev: true dev: true
/tailwindcss/3.2.1:
/tailwindcss/3.2.3:
resolution: resolution:
{ {
integrity: sha512-Uw+GVSxp5CM48krnjHObqoOwlCt5Qo6nw1jlCRwfGy68dSYb/LwS9ZFidYGRiM+w6rMawkZiu1mEMAsHYAfoLg==
integrity: sha512-Xt9D4PK4zuuQCEB8bwK9JUCKmTgUwyac/6b0/42Vqhgl6YJkep+Wf5wq+5uXYfmrupdAD0YY2NY1hyZp1HjRrg==
} }
engines: { node: ">=12.13.0" } engines: { node: ">=12.13.0" }
hasBin: true hasBin: true
@ -7582,10 +7582,10 @@ packages:
- supports-color - supports-color
dev: true dev: true
/vite-plugin-remove-console/1.1.0:
/vite-plugin-remove-console/1.2.0:
resolution: resolution:
{ {
integrity: sha512-FZ0gLEsRqgHPCl+blHpT3h004+InKrGddmBXTfs7Cj/xWY7FdHpL9Zc9kgjxh8zIzjZ/MblsPDDEqg5BVHIXDA==
integrity: sha512-1fm50pJswSeTJZZ6wBPp9Q0xUhdMqo5+drd39XRVrJ/9LmSvZ90JXf1P7P68aCTNJSf6C1KTAo7sq0PctYZURg==
} }
dev: true dev: true

2
src/api/routes.ts

@ -1,4 +1,4 @@
import { http } from "../utils/http";
import { http } from "@/utils/http";
type Result = { type Result = {
success: boolean; success: boolean;

2
src/api/user.ts

@ -1,4 +1,4 @@
import { http } from "../utils/http";
import { http } from "@/utils/http";
export type UserResult = { export type UserResult = {
success: boolean; success: boolean;

4
src/style/sidebar.scss

@ -68,10 +68,6 @@
} }
} }
.el-popper.is-light {
border: none !important;
}
.sidebar-container { .sidebar-container {
/* 展开动画 */ /* 展开动画 */
transition: width var(--pure-transition-duration); transition: width var(--pure-transition-duration);

11
src/utils/http/index.ts

@ -11,21 +11,12 @@ import {
} from "./types.d"; } from "./types.d";
import { stringify } from "qs"; import { stringify } from "qs";
import NProgress from "../progress"; import NProgress from "../progress";
// import { loadEnv } from "@build/index";
import { getToken, formatToken } from "@/utils/auth"; import { getToken, formatToken } from "@/utils/auth";
import { useUserStoreHook } from "@/store/modules/user"; import { useUserStoreHook } from "@/store/modules/user";
// 加载环境变量 VITE_PROXY_DOMAIN(开发环境) VITE_PROXY_DOMAIN_REAL(打包后的线上环境)
// const { VITE_PROXY_DOMAIN, VITE_PROXY_DOMAIN_REAL } = loadEnv();
// 相关配置请参考:www.axios-js.com/zh-cn/docs/#axios-request-config-1 // 相关配置请参考:www.axios-js.com/zh-cn/docs/#axios-request-config-1
const defaultConfig: AxiosRequestConfig = { const defaultConfig: AxiosRequestConfig = {
// baseURL:
// process.env.NODE_ENV === "production"
// ? VITE_PROXY_DOMAIN_REAL
// : VITE_PROXY_DOMAIN,
// 当前使用mock模拟请求,将baseURL制空,如果你的环境用到了http请求,请删除下面的baseURL启用上面的baseURL,并将第14行、19行代码注释取消
baseURL: "",
// 请求超时时间
timeout: 10000, timeout: 10000,
headers: { headers: {
Accept: "application/json, text/plain, */*", Accept: "application/json, text/plain, */*",

2
src/views/login/index.vue

@ -47,7 +47,7 @@ const onLogin = async (formEl: FormInstance | undefined) => {
await formEl.validate((valid, fields) => { await formEl.validate((valid, fields) => {
if (valid) { if (valid) {
useUserStoreHook() useUserStoreHook()
.loginByUsername({ username: ruleForm.username })
.loginByUsername({ username: ruleForm.username, password: "admin123" })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
// //

2
src/views/permission/page/index.vue

@ -30,7 +30,7 @@ const options = [
function onChange() { function onChange() {
useUserStoreHook() useUserStoreHook()
.loginByUsername({ username: username.value })
.loginByUsername({ username: username.value, password: "admin123" })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
usePermissionStoreHook().clearAllCachePage(); usePermissionStoreHook().clearAllCachePage();

2
types/global.d.ts

@ -86,8 +86,6 @@ declare global {
declare interface ViteEnv { declare interface ViteEnv {
VITE_PORT: number; VITE_PORT: number;
VITE_PUBLIC_PATH: string; VITE_PUBLIC_PATH: string;
VITE_PROXY_DOMAIN: string;
VITE_PROXY_DOMAIN_REAL: string;
VITE_ROUTER_HISTORY: string; VITE_ROUTER_HISTORY: string;
VITE_LEGACY: boolean; VITE_LEGACY: boolean;
VITE_CDN: boolean; VITE_CDN: boolean;

20
vite.config.ts

@ -1,7 +1,7 @@
import dayjs from "dayjs"; import dayjs from "dayjs";
import { resolve } from "path"; import { resolve } from "path";
import pkg from "./package.json"; import pkg from "./package.json";
import { warpperEnv, regExps } from "./build";
import { warpperEnv } from "./build";
import { getPluginsList } from "./build/plugins"; import { getPluginsList } from "./build/plugins";
import { UserConfigExport, ConfigEnv, loadEnv } from "vite"; import { UserConfigExport, ConfigEnv, loadEnv } from "vite";
@ -31,9 +31,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
VITE_PORT, VITE_PORT,
VITE_LEGACY, VITE_LEGACY,
VITE_COMPRESSION, VITE_COMPRESSION,
VITE_PUBLIC_PATH,
VITE_PROXY_DOMAIN,
VITE_PROXY_DOMAIN_REAL
VITE_PUBLIC_PATH
} = warpperEnv(loadEnv(mode, root)); } = warpperEnv(loadEnv(mode, root));
return { return {
base: VITE_PUBLIC_PATH, base: VITE_PUBLIC_PATH,
@ -48,18 +46,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
// 端口号 // 端口号
port: VITE_PORT, port: VITE_PORT,
host: "0.0.0.0", host: "0.0.0.0",
// 本地跨域代理
proxy:
VITE_PROXY_DOMAIN_REAL.length > 0
? {
[VITE_PROXY_DOMAIN]: {
target: VITE_PROXY_DOMAIN_REAL,
// ws: true,
changeOrigin: true,
rewrite: (path: string) => regExps(path, VITE_PROXY_DOMAIN)
}
}
: null
// 本地跨域代理 https://cn.vitejs.dev/config/server-options.html#server-proxy
proxy: {}
}, },
plugins: getPluginsList(command, VITE_LEGACY, VITE_CDN, VITE_COMPRESSION), plugins: getPluginsList(command, VITE_LEGACY, VITE_CDN, VITE_COMPRESSION),
optimizeDeps: { optimizeDeps: {

Loading…
Cancel
Save