Browse Source

chore: 同步完整版代码

i18n
xiaoxian521 2 years ago
parent
commit
936070c9ce
  1. 10
      package.json
  2. 65
      pnpm-lock.yaml
  3. 4
      src/router/utils.ts
  4. 16
      src/utils/http/index.ts

10
package.json

@ -33,11 +33,11 @@
"@pureadmin/descriptions": "^1.1.0", "@pureadmin/descriptions": "^1.1.0",
"@pureadmin/table": "^1.2.0", "@pureadmin/table": "^1.2.0",
"@pureadmin/utils": "^1.1.5", "@pureadmin/utils": "^1.1.5",
"@vueuse/core": "^9.3.0",
"@vueuse/core": "^9.4.0",
"@vueuse/motion": "^2.0.0-beta.12", "@vueuse/motion": "^2.0.0-beta.12",
"@vueuse/shared": "^9.1.1",
"@vueuse/shared": "^9.4.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^0.27.2",
"axios": "^1.1.3",
"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",
@ -56,7 +56,7 @@
"responsive-storage": "^2.1.0", "responsive-storage": "^2.1.0",
"vue": "^3.2.40", "vue": "^3.2.40",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-router": "^4.1.5",
"vue-router": "^4.1.6",
"vue-types": "^4.2.1", "vue-types": "^4.2.1",
"vxe-table": "^4.3.2", "vxe-table": "^4.3.2",
"xe-utils": "^3.5.6" "xe-utils": "^3.5.6"
@ -111,7 +111,7 @@
"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.1.8",
"tailwindcss": "^3.2.1",
"terser": "^5.15.0", "terser": "^5.15.0",
"typescript": "^4.7.4", "typescript": "^4.7.4",
"unplugin-vue-define-options": "0.7.3", "unplugin-vue-define-options": "0.7.3",

65
pnpm-lock.yaml

@ -29,12 +29,12 @@ specifiers:
"@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
"@vueuse/core": ^9.3.0
"@vueuse/core": ^9.4.0
"@vueuse/motion": ^2.0.0-beta.12 "@vueuse/motion": ^2.0.0-beta.12
"@vueuse/shared": ^9.1.1
"@vueuse/shared": ^9.4.0
animate.css: ^4.1.1 animate.css: ^4.1.1
autoprefixer: ^10.4.12 autoprefixer: ^10.4.12
axios: ^0.27.2
axios: ^1.1.3
cloc: ^2.10.0 cloc: ^2.10.0
cssnano: ^5.1.13 cssnano: ^5.1.13
dayjs: ^1.11.4 dayjs: ^1.11.4
@ -76,7 +76,7 @@ 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.1.8
tailwindcss: ^3.2.1
terser: ^5.15.0 terser: ^5.15.0
typescript: ^4.7.4 typescript: ^4.7.4
unplugin-vue-define-options: 0.7.3 unplugin-vue-define-options: 0.7.3
@ -87,7 +87,7 @@ specifiers:
vue: ^3.2.40 vue: ^3.2.40
vue-eslint-parser: ^8.2.0 vue-eslint-parser: ^8.2.0
vue-i18n: ^9.2.2 vue-i18n: ^9.2.2
vue-router: ^4.1.5
vue-router: ^4.1.6
vue-tsc: ^0.40.13 vue-tsc: ^0.40.13
vue-types: ^4.2.1 vue-types: ^4.2.1
vxe-table: ^4.3.2 vxe-table: ^4.3.2
@ -99,11 +99,11 @@ dependencies:
"@pureadmin/descriptions": 1.1.1 "@pureadmin/descriptions": 1.1.1
"@pureadmin/table": 1.2.0 "@pureadmin/table": 1.2.0
"@pureadmin/utils": 1.1.5_7f78bda4b8c80174b50d3da38250cc61 "@pureadmin/utils": 1.1.5_7f78bda4b8c80174b50d3da38250cc61
"@vueuse/core": 9.3.1[email protected]
"@vueuse/core": 9.4.0[email protected]
"@vueuse/motion": 2.0.0-[email protected] "@vueuse/motion": 2.0.0-[email protected]
"@vueuse/shared": 9.3.1[email protected]
"@vueuse/shared": 9.4.0[email protected]
animate.css: 4.1.1 animate.css: 4.1.1
axios: 0.27.2
axios: 1.1.3
dayjs: 1.11.5 dayjs: 1.11.5
echarts: 5.4.0 echarts: 5.4.0
element-plus: 2.2[email protected] element-plus: 2.2[email protected]
@ -122,7 +122,7 @@ dependencies:
responsive-storage: 2.1.0 responsive-storage: 2.1.0
vue: 3.2.41 vue: 3.2.41
vue-i18n: 9.2[email protected] vue-i18n: 9.2[email protected]
vue-router: 4.1.5[email protected]
vue-router: 4.1.6[email protected]
vue-types: 4.2[email protected] vue-types: 4.2[email protected]
vxe-table: 4.3[email protected][email protected] vxe-table: 4.3[email protected][email protected]
xe-utils: 3.5.7 xe-utils: 3.5.7
@ -177,7 +177,7 @@ devDependencies:
stylelint-config-recommended: 6.0[email protected] stylelint-config-recommended: 6.0[email protected]
stylelint-config-standard: 24.0[email protected] stylelint-config-standard: 24.0[email protected]
stylelint-order: 5.0[email protected] stylelint-order: 5.0[email protected]
tailwindcss: 3.1.8
tailwindcss: 3.2.1
terser: 5.15.1 terser: 5.15.1
typescript: 4.8.4 typescript: 4.8.4
unplugin-vue-define-options: 0.7[email protected][email protected] unplugin-vue-define-options: 0.7[email protected][email protected]
@ -1947,15 +1947,15 @@ packages:
vue-demi: 0.13[email protected] vue-demi: 0.13[email protected]
dev: false dev: false
/@vueuse/core/9.3.1[email protected]:
/@vueuse/core/9.4.0[email protected]:
resolution: resolution:
{ {
integrity: sha512-xriyD+v3D2ObH/UtnkEl+1sbcLBVHNaZaLi/rqoNEe/B92hggDEFQIGXoQUjdRzYOjASHSezf9uCDtmd7LeWyA==
integrity: sha512-JzgenGj1ZF2BHOen5rsFiAyyI9sXAv7aKhNLlm9b7SwYQeKTcxTWdhudonURCSP3Egl9NQaRBzes2lv/1JUt/Q==
} }
dependencies: dependencies:
"@types/web-bluetooth": 0.0.16 "@types/web-bluetooth": 0.0.16
"@vueuse/metadata": 9.3.1
"@vueuse/shared": 9.3.1[email protected]
"@vueuse/metadata": 9.4.0
"@vueuse/shared": 9.4.0[email protected]
vue-demi: 0.13[email protected] vue-demi: 0.13[email protected]
transitivePeerDependencies: transitivePeerDependencies:
- "@vue/composition-api" - "@vue/composition-api"
@ -1969,10 +1969,10 @@ packages:
} }
dev: false dev: false
/@vueuse/metadata/9.3.1:
/@vueuse/metadata/9.4.0:
resolution: resolution:
{ {
integrity: sha512-G1BPhtx3OHaL/y4OZBofh6Xt02G1VA9PuOO8nac9sTKMkMqfyez5VfkF3D9GUjSRNO7cVWyH4rceeGXfr2wdMg==
integrity: sha512-7GKMdGAsJyQJl35MYOz/RDpP0FxuiZBRDSN79QIPbdqYx4Sd0sVTnIC68KJ6Oln0t0SouvSUMvRHuno216Ud2Q==
} }
dev: false dev: false
@ -2015,10 +2015,10 @@ packages:
vue-demi: 0.13[email protected] vue-demi: 0.13[email protected]
dev: false dev: false
/@vueuse/shared/9.3.1[email protected]:
/@vueuse/shared/9.4.0[email protected]:
resolution: resolution:
{ {
integrity: sha512-YFu3qcnVeu0S2L4XdQJtBpDcjz6xwqHZtTv/XRhu66/yge1XVhxskUcc7VZbX52xF9A34V6KCfwncP9YDqYFiw==
integrity: sha512-fTuem51KwMCnqUKkI8B57qAIMcFovtGgsCtAeqxIzH3i6nE9VYge+gVfneNHAAy7lj8twbkNfqQSygOPJTm4tQ==
} }
dependencies: dependencies:
vue-demi: 0.13[email protected] vue-demi: 0.13[email protected]
@ -2315,14 +2315,15 @@ packages:
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
dev: true dev: true
/axios/0.27.2:
/axios/1.1.3:
resolution: resolution:
{ {
integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==
} }
dependencies: dependencies:
follow-redirects: 1.15.2 follow-redirects: 1.15.2
form-data: 4.0.0 form-data: 4.0.0
proxy-from-env: 1.1.0
transitivePeerDependencies: transitivePeerDependencies:
- debug - debug
dev: false dev: false
@ -3245,7 +3246,7 @@ packages:
"@popperjs/core": /@sxzz/popperjs-es/2.11.7 "@popperjs/core": /@sxzz/popperjs-es/2.11.7
"@types/lodash": 4.14.186 "@types/lodash": 4.14.186
"@types/lodash-es": 4.17.6 "@types/lodash-es": 4.17.6
"@vueuse/core": 9.3.1[email protected]
"@vueuse/core": 9.4.0[email protected]
async-validator: 4.2.5 async-validator: 4.2.5
dayjs: 1.11.5 dayjs: 1.11.5
escape-html: 1.0.3 escape-html: 1.0.3
@ -5947,10 +5948,10 @@ packages:
postcss-selector-parser: 6.0.10 postcss-selector-parser: 6.0.10
dev: true dev: true
/postcss-nested/5.0.6[email protected]:
/postcss-nested/6.0.0[email protected]:
resolution: resolution:
{ {
integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==
integrity: sha512-0DkamqrPcmkBDsLn+vQDIrtkSbNkv5AD/M322ySo9kqFkCIYklym2xEmWkwo+Y3/qZo34tzEPNUw4y7yMCdv5w==
} }
engines: { node: ">=12.0" } engines: { node: ">=12.0" }
peerDependencies: peerDependencies:
@ -6271,6 +6272,13 @@ packages:
engines: { node: ">= 0.6.0" } engines: { node: ">= 0.6.0" }
dev: false dev: false
/proxy-from-env/1.1.0:
resolution:
{
integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
}
dev: false
/pump/3.0.0: /pump/3.0.0:
resolution: resolution:
{ {
@ -7143,10 +7151,10 @@ packages:
strip-ansi: 6.0.1 strip-ansi: 6.0.1
dev: true dev: true
/tailwindcss/3.1.8:
/tailwindcss/3.2.1:
resolution: resolution:
{ {
integrity: sha512-YSneUCZSFDYMwk+TGq8qYFdCA3yfBRdBlS7txSq0LUmzyeqRe3a8fBQzbz9M3WS/iFT4BNf/nmw9mEzrnSaC0g==
integrity: sha512-Uw+GVSxp5CM48krnjHObqoOwlCt5Qo6nw1jlCRwfGy68dSYb/LwS9ZFidYGRiM+w6rMawkZiu1mEMAsHYAfoLg==
} }
engines: { node: ">=12.13.0" } engines: { node: ">=12.13.0" }
hasBin: true hasBin: true
@ -7161,6 +7169,7 @@ packages:
glob-parent: 6.0.2 glob-parent: 6.0.2
is-glob: 4.0.3 is-glob: 4.0.3
lilconfig: 2.0.6 lilconfig: 2.0.6
micromatch: 4.0.5
normalize-path: 3.0.0 normalize-path: 3.0.0
object-hash: 3.0.0 object-hash: 3.0.0
picocolors: 1.0.0 picocolors: 1.0.0
@ -7168,7 +7177,7 @@ packages:
postcss-import: 14.1[email protected] postcss-import: 14.1[email protected]
postcss-js: 4.0[email protected] postcss-js: 4.0[email protected]
postcss-load-config: 3.1[email protected] postcss-load-config: 3.1[email protected]
postcss-nested: 5.0.6[email protected]
postcss-nested: 6.0.0[email protected]
postcss-selector-parser: 6.0.10 postcss-selector-parser: 6.0.10
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
quick-lru: 5.1.1 quick-lru: 5.1.1
@ -7620,10 +7629,10 @@ packages:
vue: 3.2.41 vue: 3.2.41
dev: false dev: false
/vue-router/4.1.5[email protected]:
/vue-router/4.1.6[email protected]:
resolution: resolution:
{ {
integrity: sha512-IsvoF5D2GQ/EGTs/Th4NQms9gd2NSqV+yylxIyp/OYp8xOwxmU8Kj/74E9DTSYAyH5LX7idVUngN3JSj1X4xcQ==
integrity: sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==
} }
peerDependencies: peerDependencies:
vue: ^3.2.0 vue: ^3.2.0

4
src/router/utils.ts

@ -270,9 +270,9 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
// 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值 // 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值
if (v?.children && v.children.length && !v.redirect) if (v?.children && v.children.length && !v.redirect)
v.redirect = v.children[0].path; v.redirect = v.children[0].path;
// 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值
// 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值(注意:测试中发现父级的name不能和子级name重复,如果重复会造成重定向无效(跳转404),所以这里给父级的name起名的时候后面会自动加上`Parent`,避免重复)
if (v?.children && v.children.length && !v.name) if (v?.children && v.children.length && !v.name)
v.name = v.children[0].name;
v.name = (v.children[0].name as string) + "Parent";
if (v.meta?.frameSrc) { if (v.meta?.frameSrc) {
v.component = IFrame; v.component = IFrame;
} else { } else {

16
src/utils/http/index.ts

@ -1,11 +1,15 @@
import Axios, { AxiosInstance, AxiosRequestConfig } from "axios";
import Axios, {
AxiosInstance,
AxiosRequestConfig,
CustomParamsSerializer
} from "axios";
import { import {
PureHttpError, PureHttpError,
RequestMethods, RequestMethods,
PureHttpResponse, PureHttpResponse,
PureHttpRequestConfig PureHttpRequestConfig
} from "./types.d"; } from "./types.d";
import qs from "qs";
import { stringify } from "qs";
import NProgress from "../progress"; import NProgress from "../progress";
// import { loadEnv } from "@build/index"; // import { loadEnv } from "@build/index";
import { getToken } from "/@/utils/auth"; import { getToken } from "/@/utils/auth";
@ -20,7 +24,7 @@ const defaultConfig: AxiosRequestConfig = {
// process.env.NODE_ENV === "production" // process.env.NODE_ENV === "production"
// ? VITE_PROXY_DOMAIN_REAL // ? VITE_PROXY_DOMAIN_REAL
// : VITE_PROXY_DOMAIN, // : VITE_PROXY_DOMAIN,
// 当前使用mock模拟请求,将baseURL制空,如果你的环境用到了http请求,请删除下面的baseURL启用上面的baseURL,并将第10行、15行代码注释取消
// 当前使用mock模拟请求,将baseURL制空,如果你的环境用到了http请求,请删除下面的baseURL启用上面的baseURL,并将第14行、19行代码注释取消
baseURL: "", baseURL: "",
timeout: 10000, timeout: 10000,
headers: { headers: {
@ -28,8 +32,10 @@ const defaultConfig: AxiosRequestConfig = {
"Content-Type": "application/json", "Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest" "X-Requested-With": "XMLHttpRequest"
}, },
// 数组格式参数序列化
paramsSerializer: params => qs.stringify(params, { indices: false })
// 数组格式参数序列化(https://github.com/axios/axios/issues/5142)
paramsSerializer: {
serialize: stringify as unknown as CustomParamsSerializer
}
}; };
class PureHttp { class PureHttp {

Loading…
Cancel
Save