mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-14 22:30:31 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dd1c67280 | ||
|
|
7d419c3b35 | ||
|
|
6ceb37624f | ||
|
|
fdf12660c1 | ||
|
|
49cdcf216f | ||
|
|
936070c9ce |
@@ -8,4 +8,12 @@ VITE_ROUTER_HISTORY = "hash"
|
|||||||
VITE_PROXY_DOMAIN_REAL = ""
|
VITE_PROXY_DOMAIN_REAL = ""
|
||||||
|
|
||||||
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
|
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
|
||||||
VITE_LEGACY = false
|
VITE_LEGACY = false
|
||||||
|
|
||||||
|
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
|
||||||
|
VITE_CDN = false
|
||||||
|
|
||||||
|
# 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件)
|
||||||
|
# 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||||
|
# 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||||
|
VITE_COMPRESSION = "none"
|
||||||
@@ -12,3 +12,11 @@ VITE_PROXY_DOMAIN_REAL = ""
|
|||||||
|
|
||||||
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
|
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
|
||||||
VITE_LEGACY = false
|
VITE_LEGACY = false
|
||||||
|
|
||||||
|
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
|
||||||
|
VITE_CDN = false
|
||||||
|
|
||||||
|
# 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件)
|
||||||
|
# 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||||
|
# 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||||
|
VITE_COMPRESSION = "none"
|
||||||
67
build/cdn.ts
Normal file
67
build/cdn.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import { Plugin as importToCDN } from "vite-plugin-cdn-import";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 打包时采用`cdn`模式,仅限外网使用(默认不采用,如果需要采用cdn模式,请在 .env.production 文件,将 VITE_CDN 设置成true)
|
||||||
|
* 平台采用国内cdn:https://www.bootcdn.cn,当然你也可以选择 https://unpkg.com 或者 https://www.jsdelivr.com
|
||||||
|
* 提醒:mockjs不能用cdn模式引入,会报错。正确的方式是,生产环境删除mockjs,使用真实的后端请求
|
||||||
|
* 注意:上面提到的仅限外网使用也不是完全肯定的,如果你们公司内网部署的有相关js、css文件,也可以将下面配置对应改一下,整一套内网版cdn
|
||||||
|
*/
|
||||||
|
export const cdn = importToCDN({
|
||||||
|
//(prodUrl解释: name: 对应下面modules的name,version: 自动读取本地package.json中dependencies依赖中对应包的版本号,path: 对应下面modules的path)
|
||||||
|
prodUrl: "https://cdn.bootcdn.net/ajax/libs/{name}/{version}/{path}",
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
name: "vue",
|
||||||
|
var: "Vue",
|
||||||
|
path: "vue.global.prod.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "vue-router",
|
||||||
|
var: "VueRouter",
|
||||||
|
path: "vue-router.global.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "vue-i18n",
|
||||||
|
var: "VueI18n",
|
||||||
|
path: "vue-i18n.runtime.global.prod.min.js"
|
||||||
|
},
|
||||||
|
// 项目中没有直接安装vue-demi,但是pinia用到了,所以需要在引入pinia前引入vue-demi(https://github.com/vuejs/pinia/blob/v2/packages/pinia/package.json#L77)
|
||||||
|
{
|
||||||
|
name: "vue-demi",
|
||||||
|
var: "VueDemi",
|
||||||
|
path: "index.iife.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "pinia",
|
||||||
|
var: "Pinia",
|
||||||
|
path: "pinia.iife.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "element-plus",
|
||||||
|
var: "ElementPlus",
|
||||||
|
path: "index.full.min.js",
|
||||||
|
css: "index.min.css"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "axios",
|
||||||
|
var: "axios",
|
||||||
|
path: "axios.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dayjs",
|
||||||
|
var: "dayjs",
|
||||||
|
path: "dayjs.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "echarts",
|
||||||
|
var: "echarts",
|
||||||
|
path: "echarts.min.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "lodash",
|
||||||
|
var: "lodash",
|
||||||
|
// 可写`完整路径`,会替换`prodUrl`
|
||||||
|
path: "https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
63
build/compress.ts
Normal file
63
build/compress.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import type { Plugin } from "vite";
|
||||||
|
import { isArray } from "@pureadmin/utils";
|
||||||
|
import compressPlugin from "vite-plugin-compression";
|
||||||
|
|
||||||
|
export const configCompressPlugin = (
|
||||||
|
compress: ViteCompression
|
||||||
|
): Plugin | Plugin[] => {
|
||||||
|
if (compress === "none") return null;
|
||||||
|
|
||||||
|
const gz = {
|
||||||
|
// 生成的压缩包后缀
|
||||||
|
ext: ".gz",
|
||||||
|
// 体积大于threshold才会被压缩
|
||||||
|
threshold: 0,
|
||||||
|
// 默认压缩.js|mjs|json|css|html后缀文件,设置成true,压缩全部文件
|
||||||
|
filter: () => true,
|
||||||
|
// 压缩后是否删除原始文件
|
||||||
|
deleteOriginFile: false
|
||||||
|
};
|
||||||
|
const br = {
|
||||||
|
ext: ".br",
|
||||||
|
algorithm: "brotliCompress",
|
||||||
|
threshold: 0,
|
||||||
|
filter: () => true,
|
||||||
|
deleteOriginFile: false
|
||||||
|
};
|
||||||
|
|
||||||
|
const codeList = [
|
||||||
|
{ k: "gzip", v: gz },
|
||||||
|
{ k: "brotli", v: br },
|
||||||
|
{ k: "both", v: [gz, br] }
|
||||||
|
];
|
||||||
|
|
||||||
|
const plugins: Plugin[] = [];
|
||||||
|
|
||||||
|
codeList.forEach(item => {
|
||||||
|
if (compress.includes(item.k)) {
|
||||||
|
if (compress.includes("clear")) {
|
||||||
|
if (isArray(item.v)) {
|
||||||
|
item.v.forEach(vItem => {
|
||||||
|
plugins.push(
|
||||||
|
compressPlugin(Object.assign(vItem, { deleteOriginFile: true }))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
plugins.push(
|
||||||
|
compressPlugin(Object.assign(item.v, { deleteOriginFile: true }))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isArray(item.v)) {
|
||||||
|
item.v.forEach(vItem => {
|
||||||
|
plugins.push(compressPlugin(vItem));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
plugins.push(compressPlugin(item.v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return plugins;
|
||||||
|
};
|
||||||
@@ -7,7 +7,9 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
|
|||||||
VITE_PROXY_DOMAIN: "",
|
VITE_PROXY_DOMAIN: "",
|
||||||
VITE_PROXY_DOMAIN_REAL: "",
|
VITE_PROXY_DOMAIN_REAL: "",
|
||||||
VITE_ROUTER_HISTORY: "",
|
VITE_ROUTER_HISTORY: "",
|
||||||
VITE_LEGACY: false
|
VITE_LEGACY: false,
|
||||||
|
VITE_CDN: false,
|
||||||
|
VITE_COMPRESSION: "none"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const envName of Object.keys(envConf)) {
|
for (const envName of Object.keys(envConf)) {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { cdn } from "./cdn";
|
||||||
import { resolve } from "path";
|
import { resolve } from "path";
|
||||||
import vue from "@vitejs/plugin-vue";
|
import vue from "@vitejs/plugin-vue";
|
||||||
import { viteBuildInfo } from "./info";
|
import { viteBuildInfo } from "./info";
|
||||||
@@ -5,15 +6,21 @@ import svgLoader from "vite-svg-loader";
|
|||||||
import legacy from "@vitejs/plugin-legacy";
|
import legacy from "@vitejs/plugin-legacy";
|
||||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||||
import { viteMockServe } from "vite-plugin-mock";
|
import { viteMockServe } from "vite-plugin-mock";
|
||||||
|
import { configCompressPlugin } from "./compress";
|
||||||
import VueI18n from "@intlify/vite-plugin-vue-i18n";
|
import VueI18n from "@intlify/vite-plugin-vue-i18n";
|
||||||
// import ElementPlus from "unplugin-element-plus/vite";
|
// import ElementPlus from "unplugin-element-plus/vite";
|
||||||
import { visualizer } from "rollup-plugin-visualizer";
|
import { visualizer } from "rollup-plugin-visualizer";
|
||||||
import removeConsole from "vite-plugin-remove-console";
|
import removeConsole from "vite-plugin-remove-console";
|
||||||
import themePreprocessorPlugin from "@pureadmin/theme";
|
import themePreprocessorPlugin from "@pureadmin/theme";
|
||||||
import { genScssMultipleScopeVars } from "/@/layout/theme";
|
|
||||||
import DefineOptions from "unplugin-vue-define-options/vite";
|
import DefineOptions from "unplugin-vue-define-options/vite";
|
||||||
|
import { genScssMultipleScopeVars } from "../src/layout/theme";
|
||||||
|
|
||||||
export function getPluginsList(command, VITE_LEGACY) {
|
export function getPluginsList(
|
||||||
|
command: string,
|
||||||
|
VITE_LEGACY: boolean,
|
||||||
|
VITE_CDN: boolean,
|
||||||
|
VITE_COMPRESSION: ViteCompression
|
||||||
|
) {
|
||||||
const prodMock = true;
|
const prodMock = true;
|
||||||
const lifecycle = process.env.npm_lifecycle_event;
|
const lifecycle = process.env.npm_lifecycle_event;
|
||||||
return [
|
return [
|
||||||
@@ -26,6 +33,8 @@ export function getPluginsList(command, VITE_LEGACY) {
|
|||||||
}),
|
}),
|
||||||
// jsx、tsx语法支持
|
// jsx、tsx语法支持
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
|
VITE_CDN ? cdn : null,
|
||||||
|
configCompressPlugin(VITE_COMPRESSION),
|
||||||
DefineOptions(),
|
DefineOptions(),
|
||||||
// 线上环境删除console
|
// 线上环境删除console
|
||||||
removeConsole({ external: ["src/assets/iconfont/iconfont.js"] }),
|
removeConsole({ external: ["src/assets/iconfont/iconfont.js"] }),
|
||||||
|
|||||||
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pure-admin-thin",
|
"name": "pure-admin-thin",
|
||||||
"version": "3.6.0",
|
"version": "3.6.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
||||||
@@ -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,11 +111,13 @@
|
|||||||
"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",
|
||||||
"vite": "^3.1.8",
|
"vite": "^3.1.8",
|
||||||
|
"vite-plugin-cdn-import": "^0.3.5",
|
||||||
|
"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.1.0",
|
||||||
"vite-svg-loader": "^3.6.0",
|
"vite-svg-loader": "^3.6.0",
|
||||||
|
|||||||
122
pnpm-lock.yaml
generated
122
pnpm-lock.yaml
generated
@@ -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,18 +76,20 @@ 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
|
||||||
vite: ^3.1.8
|
vite: ^3.1.8
|
||||||
|
vite-plugin-cdn-import: ^0.3.5
|
||||||
|
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.1.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
|
||||||
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 +101,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_vue@3.2.41
|
"@vueuse/core": 9.4.0_vue@3.2.41
|
||||||
"@vueuse/motion": 2.0.0-beta.12_vue@3.2.41
|
"@vueuse/motion": 2.0.0-beta.12_vue@3.2.41
|
||||||
"@vueuse/shared": 9.3.1_vue@3.2.41
|
"@vueuse/shared": 9.4.0_vue@3.2.41
|
||||||
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.18_vue@3.2.41
|
element-plus: 2.2.18_vue@3.2.41
|
||||||
@@ -122,7 +124,7 @@ dependencies:
|
|||||||
responsive-storage: 2.1.0
|
responsive-storage: 2.1.0
|
||||||
vue: 3.2.41
|
vue: 3.2.41
|
||||||
vue-i18n: 9.2.2_vue@3.2.41
|
vue-i18n: 9.2.2_vue@3.2.41
|
||||||
vue-router: 4.1.5_vue@3.2.41
|
vue-router: 4.1.6_vue@3.2.41
|
||||||
vue-types: 4.2.1_vue@3.2.41
|
vue-types: 4.2.1_vue@3.2.41
|
||||||
vxe-table: 4.3.5_vue@3.2.41+xe-utils@3.5.7
|
vxe-table: 4.3.5_vue@3.2.41+xe-utils@3.5.7
|
||||||
xe-utils: 3.5.7
|
xe-utils: 3.5.7
|
||||||
@@ -177,11 +179,13 @@ 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.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.3_vite@3.1.8+vue@3.2.41
|
unplugin-vue-define-options: 0.7.3_vite@3.1.8+vue@3.2.41
|
||||||
vite: 3.1.8_sass@1.55.0+terser@5.15.1
|
vite: 3.1.8_sass@1.55.0+terser@5.15.1
|
||||||
|
vite-plugin-cdn-import: 0.3.5
|
||||||
|
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.1.0
|
||||||
vite-svg-loader: 3.6.0
|
vite-svg-loader: 3.6.0
|
||||||
@@ -1947,15 +1951,15 @@ packages:
|
|||||||
vue-demi: 0.13.11_vue@3.2.41
|
vue-demi: 0.13.11_vue@3.2.41
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@vueuse/core/9.3.1_vue@3.2.41:
|
/@vueuse/core/9.4.0_vue@3.2.41:
|
||||||
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/metadata": 9.4.0
|
||||||
"@vueuse/shared": 9.3.1_vue@3.2.41
|
"@vueuse/shared": 9.4.0_vue@3.2.41
|
||||||
vue-demi: 0.13.11_vue@3.2.41
|
vue-demi: 0.13.11_vue@3.2.41
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- "@vue/composition-api"
|
- "@vue/composition-api"
|
||||||
@@ -1969,10 +1973,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 +2019,10 @@ packages:
|
|||||||
vue-demi: 0.13.11_vue@3.2.41
|
vue-demi: 0.13.11_vue@3.2.41
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@vueuse/shared/9.3.1_vue@3.2.41:
|
/@vueuse/shared/9.4.0_vue@3.2.41:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-YFu3qcnVeu0S2L4XdQJtBpDcjz6xwqHZtTv/XRhu66/yge1XVhxskUcc7VZbX52xF9A34V6KCfwncP9YDqYFiw==
|
integrity: sha512-fTuem51KwMCnqUKkI8B57qAIMcFovtGgsCtAeqxIzH3i6nE9VYge+gVfneNHAAy7lj8twbkNfqQSygOPJTm4tQ==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
vue-demi: 0.13.11_vue@3.2.41
|
vue-demi: 0.13.11_vue@3.2.41
|
||||||
@@ -2315,14 +2319,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 +3250,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_vue@3.2.41
|
"@vueuse/core": 9.4.0_vue@3.2.41
|
||||||
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
|
||||||
@@ -4669,6 +4674,15 @@ packages:
|
|||||||
}
|
}
|
||||||
engines: { node: ">=0.10.0" }
|
engines: { node: ">=0.10.0" }
|
||||||
|
|
||||||
|
/is-reference/1.2.1:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==
|
||||||
|
}
|
||||||
|
dependencies:
|
||||||
|
"@types/estree": 0.0.39
|
||||||
|
dev: true
|
||||||
|
|
||||||
/is-regexp/1.0.0:
|
/is-regexp/1.0.0:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -5947,10 +5961,10 @@ packages:
|
|||||||
postcss-selector-parser: 6.0.10
|
postcss-selector-parser: 6.0.10
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/postcss-nested/5.0.6_postcss@8.4.18:
|
/postcss-nested/6.0.0_postcss@8.4.18:
|
||||||
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 +6285,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:
|
||||||
{
|
{
|
||||||
@@ -6516,6 +6537,23 @@ packages:
|
|||||||
glob: 7.2.3
|
glob: 7.2.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/rollup-plugin-external-globals/0.6.1:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-mlp3KNa5sE4Sp9UUR2rjBrxjG79OyZAh/QC18RHIjM+iYkbBwNXSo8DHRMZWtzJTrH8GxQ+SJvCTN3i14uMXIA==
|
||||||
|
}
|
||||||
|
peerDependencies:
|
||||||
|
rollup: ^2.25.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
rollup:
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
"@rollup/pluginutils": 4.2.1
|
||||||
|
estree-walker: 2.0.2
|
||||||
|
is-reference: 1.2.1
|
||||||
|
magic-string: 0.25.9
|
||||||
|
dev: true
|
||||||
|
|
||||||
/rollup-plugin-visualizer/5.8.3:
|
/rollup-plugin-visualizer/5.8.3:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -7143,10 +7181,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 +7199,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 +7207,7 @@ packages:
|
|||||||
postcss-import: 14.1.0_postcss@8.4.18
|
postcss-import: 14.1.0_postcss@8.4.18
|
||||||
postcss-js: 4.0.0_postcss@8.4.18
|
postcss-js: 4.0.0_postcss@8.4.18
|
||||||
postcss-load-config: 3.1.4_postcss@8.4.18
|
postcss-load-config: 3.1.4_postcss@8.4.18
|
||||||
postcss-nested: 5.0.6_postcss@8.4.18
|
postcss-nested: 6.0.0_postcss@8.4.18
|
||||||
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
|
||||||
@@ -7490,6 +7529,33 @@ packages:
|
|||||||
spdx-expression-parse: 3.0.1
|
spdx-expression-parse: 3.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/vite-plugin-cdn-import/0.3.5:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-e1raoalfBiIhv+hnMeSp1UNjloDDBhHpeFxkwRRdPBmTdDRqdEEn8owUmT5u8UBSVCs4xN3n/od4a91vXEhXPQ==
|
||||||
|
}
|
||||||
|
dependencies:
|
||||||
|
rollup-plugin-external-globals: 0.6.1
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- rollup
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/vite-plugin-compression/0.5.1_vite@3.1.8:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==
|
||||||
|
}
|
||||||
|
peerDependencies:
|
||||||
|
vite: ">=2.0.0"
|
||||||
|
dependencies:
|
||||||
|
chalk: 4.1.2
|
||||||
|
debug: 4.3.4
|
||||||
|
fs-extra: 10.1.0
|
||||||
|
vite: 3.1.8_sass@1.55.0+terser@5.15.1
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
|
dev: true
|
||||||
|
|
||||||
/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:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -7620,10 +7686,10 @@ packages:
|
|||||||
vue: 3.2.41
|
vue: 3.2.41
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/vue-router/4.1.5_vue@3.2.41:
|
/vue-router/4.1.6_vue@3.2.41:
|
||||||
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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Version": "3.6.0",
|
"Version": "3.6.2",
|
||||||
"Title": "PureAdmin",
|
"Title": "PureAdmin",
|
||||||
"FixedHeader": true,
|
"FixedHeader": true,
|
||||||
"HiddenSideBar": false,
|
"HiddenSideBar": false,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineComponent, Fragment } from "vue";
|
import { defineComponent, Fragment } from "vue";
|
||||||
import { hasAuth } from "/@/router/utils";
|
import { hasAuth } from "@/router/utils";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Auth",
|
name: "Auth",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { hasAuth } from "/@/router/utils";
|
import { hasAuth } from "@/router/utils";
|
||||||
import { Directive, type DirectiveBinding } from "vue";
|
import { Directive, type DirectiveBinding } from "vue";
|
||||||
|
|
||||||
export const auth: Directive = {
|
export const auth: Directive = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Directive, type DirectiveBinding, type VNode } from "vue";
|
import { Directive, type DirectiveBinding, type VNode } from "vue";
|
||||||
import elementResizeDetectorMaker from "element-resize-detector";
|
import elementResizeDetectorMaker from "element-resize-detector";
|
||||||
import type { Erd } from "element-resize-detector";
|
import type { Erd } from "element-resize-detector";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
|
|
||||||
const erd: Erd = elementResizeDetectorMaker({
|
const erd: Erd = elementResizeDetectorMaker({
|
||||||
strategy: "scroll"
|
strategy: "scroll"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import backTop from "/@/assets/svg/back_top.svg?component";
|
import backTop from "@/assets/svg/back_top.svg?component";
|
||||||
import { h, computed, Transition, defineComponent } from "vue";
|
import { h, computed, Transition, defineComponent } from "vue";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
fixedHeader: Boolean
|
fixedHeader: Boolean
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
import Search from "./search/index.vue";
|
import Search from "./search/index.vue";
|
||||||
import Notice from "./notice/index.vue";
|
import Notice from "./notice/index.vue";
|
||||||
import mixNav from "./sidebar/mixNav.vue";
|
import mixNav from "./sidebar/mixNav.vue";
|
||||||
import avatars from "/@/assets/avatars.jpg";
|
import avatars from "@/assets/avatars.jpg";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import Breadcrumb from "./sidebar/breadCrumb.vue";
|
import Breadcrumb from "./sidebar/breadCrumb.vue";
|
||||||
import topCollapse from "./sidebar/topCollapse.vue";
|
import topCollapse from "./sidebar/topCollapse.vue";
|
||||||
import { useTranslationLang } from "../hooks/useTranslationLang";
|
import { useTranslationLang } from "../hooks/useTranslationLang";
|
||||||
import globalization from "/@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
layout,
|
layout,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { onClickOutside } from "@vueuse/core";
|
import { onClickOutside } from "@vueuse/core";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
|
|
||||||
let show = ref<Boolean>(false);
|
let show = ref<Boolean>(false);
|
||||||
const target = ref(null);
|
const target = ref(null);
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import enterOutlined from "/@/assets/svg/enter_outlined.svg?component";
|
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
|
||||||
import mdiKeyboardEsc from "/@/assets/svg/mdi_keyboard_esc.svg?component";
|
import mdiKeyboardEsc from "@/assets/svg/mdi_keyboard_esc.svg?component";
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.search-footer {
|
.search-footer {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import { useRouter } from "vue-router";
|
|||||||
import { cloneDeep } from "lodash-unified";
|
import { cloneDeep } from "lodash-unified";
|
||||||
import SearchResult from "./SearchResult.vue";
|
import SearchResult from "./SearchResult.vue";
|
||||||
import SearchFooter from "./SearchFooter.vue";
|
import SearchFooter from "./SearchFooter.vue";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { transformI18n } from "/@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { deleteChildren } from "@pureadmin/utils";
|
import { deleteChildren } from "@pureadmin/utils";
|
||||||
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
|
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
|
||||||
import { ref, watch, computed, nextTick, shallowRef } from "vue";
|
import { ref, watch, computed, nextTick, shallowRef } from "vue";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/** 弹窗显隐 */
|
/** 弹窗显隐 */
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import enterOutlined from "/@/assets/svg/enter_outlined.svg?component";
|
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ import {
|
|||||||
nextTick,
|
nextTick,
|
||||||
useCssModule
|
useCssModule
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import panel from "../panel/index.vue";
|
import panel from "../panel/index.vue";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { resetRouter } from "/@/router";
|
import { resetRouter } from "@/router";
|
||||||
import { templateRef } from "@vueuse/core";
|
import { templateRef } from "@vueuse/core";
|
||||||
import { removeToken } from "/@/utils/auth";
|
import { removeToken } from "@/utils/auth";
|
||||||
import { routerArrays } from "/@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { useAppStoreHook } from "/@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
|
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||||
import {
|
import {
|
||||||
useDark,
|
useDark,
|
||||||
debounce,
|
debounce,
|
||||||
@@ -29,8 +29,8 @@ import {
|
|||||||
} from "@pureadmin/utils";
|
} from "@pureadmin/utils";
|
||||||
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
||||||
|
|
||||||
import dayIcon from "/@/assets/svg/day.svg?component";
|
import dayIcon from "@/assets/svg/day.svg?component";
|
||||||
import darkIcon from "/@/assets/svg/dark.svg?component";
|
import darkIcon from "@/assets/svg/dark.svg?component";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { device } = useNav();
|
const { device } = useNav();
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { isEqual } from "lodash-unified";
|
import { isEqual } from "lodash-unified";
|
||||||
import { transformI18n } from "/@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { ref, watch, onMounted, toRaw } from "vue";
|
import { ref, watch, onMounted, toRaw } from "vue";
|
||||||
import { getParentPaths, findRouteByPath } from "/@/router/utils";
|
import { getParentPaths, findRouteByPath } from "@/router/utils";
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
|
import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import Search from "../search/index.vue";
|
|||||||
import Notice from "../notice/index.vue";
|
import Notice from "../notice/index.vue";
|
||||||
import { ref, watch, nextTick } from "vue";
|
import { ref, watch, nextTick } from "vue";
|
||||||
import SidebarItem from "./sidebarItem.vue";
|
import SidebarItem from "./sidebarItem.vue";
|
||||||
import avatars from "/@/assets/avatars.jpg";
|
import avatars from "@/assets/avatars.jpg";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import globalization from "/@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
|
||||||
const menuRef = ref();
|
const menuRef = ref();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
collapse: Boolean
|
collapse: Boolean
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Search from "../search/index.vue";
|
import Search from "../search/index.vue";
|
||||||
import Notice from "../notice/index.vue";
|
import Notice from "../notice/index.vue";
|
||||||
import avatars from "/@/assets/avatars.jpg";
|
import avatars from "@/assets/avatars.jpg";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { transformI18n } from "/@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { ref, toRaw, watch, onMounted, nextTick } from "vue";
|
import { ref, toRaw, watch, onMounted, nextTick } from "vue";
|
||||||
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import { getParentPaths, findRouteByPath } from "/@/router/utils";
|
import { getParentPaths, findRouteByPath } from "@/router/utils";
|
||||||
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import globalization from "/@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
|
||||||
const menuRef = ref();
|
const menuRef = ref();
|
||||||
let defaultActive = ref(null);
|
let defaultActive = ref(null);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { childrenType } from "../../types";
|
import { childrenType } from "../../types";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { transformI18n } from "/@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue";
|
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue";
|
||||||
|
|
||||||
const { layout, isCollapse } = useNav();
|
const { layout, isCollapse } = useNav();
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Logo from "./logo.vue";
|
import Logo from "./logo.vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import SidebarItem from "./sidebarItem.vue";
|
import SidebarItem from "./sidebarItem.vue";
|
||||||
import leftCollapse from "./leftCollapse.vue";
|
import leftCollapse from "./leftCollapse.vue";
|
||||||
import type { StorageConfigs } from "/#/index";
|
import type { StorageConfigs } from "/#/index";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { storageLocal } from "@pureadmin/utils";
|
import { storageLocal } from "@pureadmin/utils";
|
||||||
import { ref, computed, watch, onBeforeMount } from "vue";
|
import { ref, computed, watch, onBeforeMount } from "vue";
|
||||||
import { findRouteByPath, getParentPaths } from "/@/router/utils";
|
import { findRouteByPath, getParentPaths } from "@/router/utils";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const showLogo = ref(
|
const showLogo = ref(
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { $t } from "/@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { RouteConfigs } from "../../types";
|
import { RouteConfigs } from "../../types";
|
||||||
import { useTags } from "../../hooks/useTag";
|
import { useTags } from "../../hooks/useTag";
|
||||||
import { routerArrays } from "/@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
import { isEqual, isEmpty } from "lodash-unified";
|
import { isEqual, isEmpty } from "lodash-unified";
|
||||||
import { useSettingStoreHook } from "/@/store/modules/settings";
|
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||||
import { ref, watch, unref, nextTick, onBeforeMount } from "vue";
|
import { ref, watch, unref, nextTick, onBeforeMount } from "vue";
|
||||||
import { handleAliveRoute, delAliveRoutes } from "/@/router/utils";
|
import { handleAliveRoute, delAliveRoutes } from "@/router/utils";
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { useResizeObserver, useDebounceFn, useFullscreen } from "@vueuse/core";
|
import { useResizeObserver, useDebounceFn, useFullscreen } from "@vueuse/core";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
import { find } from "lodash-unified";
|
import { find } from "lodash-unified";
|
||||||
import { useLayout } from "./useLayout";
|
import { useLayout } from "./useLayout";
|
||||||
import { themeColorsType } from "../types";
|
import { themeColorsType } from "../types";
|
||||||
import { TinyColor } from "@ctrl/tinycolor";
|
import { TinyColor } from "@ctrl/tinycolor";
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import {
|
import {
|
||||||
darken,
|
darken,
|
||||||
lighten,
|
lighten,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { computed } from "vue";
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { routerArrays } from "../types";
|
import { routerArrays } from "../types";
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { useMultiTagsStore } from "/@/store/modules/multiTags";
|
import { useMultiTagsStore } from "@/store/modules/multiTags";
|
||||||
|
|
||||||
export function useLayout() {
|
export function useLayout() {
|
||||||
const { $storage, $config } = useGlobal<GlobalPropertiesApi>();
|
const { $storage, $config } = useGlobal<GlobalPropertiesApi>();
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { routeMetaType } from "../types";
|
import { routeMetaType } from "../types";
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { transformI18n } from "/@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { router, remainingPaths } from "/@/router";
|
import { router, remainingPaths } from "@/router";
|
||||||
import { useAppStoreHook } from "/@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { useUserStoreHook } from "/@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
|
|
||||||
const errorInfo = "当前路由配置不正确,请检查配置";
|
const errorInfo = "当前路由配置不正确,请检查配置";
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import { isEqual } from "lodash-unified";
|
|||||||
import type { StorageConfigs } from "/#/index";
|
import type { StorageConfigs } from "/#/index";
|
||||||
import { useEventListener } from "@vueuse/core";
|
import { useEventListener } from "@vueuse/core";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { transformI18n, $t } from "/@/plugins/i18n";
|
import { transformI18n, $t } from "@/plugins/i18n";
|
||||||
import { useSettingStoreHook } from "/@/store/modules/settings";
|
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils";
|
import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils";
|
||||||
|
|
||||||
export function useTags() {
|
export function useTags() {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { setType } from "./types";
|
import { setType } from "./types";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { useLayout } from "./hooks/useLayout";
|
import { useLayout } from "./hooks/useLayout";
|
||||||
import { useAppStoreHook } from "/@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { useSettingStoreHook } from "/@/store/modules/settings";
|
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||||
import { deviceDetection, useDark, useGlobal } from "@pureadmin/utils";
|
import { deviceDetection, useDark, useGlobal } from "@pureadmin/utils";
|
||||||
import { h, reactive, computed, onMounted, defineComponent } from "vue";
|
import { h, reactive, computed, onMounted, defineComponent } from "vue";
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ import appMain from "./components/appMain.vue";
|
|||||||
import setting from "./components/setting/index.vue";
|
import setting from "./components/setting/index.vue";
|
||||||
import Vertical from "./components/sidebar/vertical.vue";
|
import Vertical from "./components/sidebar/vertical.vue";
|
||||||
import Horizontal from "./components/sidebar/horizontal.vue";
|
import Horizontal from "./components/sidebar/horizontal.vue";
|
||||||
import backTop from "/@/assets/svg/back_top.svg?component";
|
import backTop from "@/assets/svg/back_top.svg?component";
|
||||||
|
|
||||||
const { isDark } = useDark();
|
const { isDark } = useDark();
|
||||||
const { layout } = useLayout();
|
const { layout } = useLayout();
|
||||||
|
|||||||
14
src/main.ts
14
src/main.ts
@@ -1,14 +1,14 @@
|
|||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import { setupStore } from "/@/store";
|
import { setupStore } from "@/store";
|
||||||
import ElementPlus from "element-plus";
|
import ElementPlus from "element-plus";
|
||||||
|
import { useI18n } from "@/plugins/i18n";
|
||||||
import { getServerConfig } from "./config";
|
import { getServerConfig } from "./config";
|
||||||
import { createApp, Directive } from "vue";
|
import { createApp, Directive } from "vue";
|
||||||
import { useI18n } from "../src/plugins/i18n";
|
|
||||||
import { MotionPlugin } from "@vueuse/motion";
|
import { MotionPlugin } from "@vueuse/motion";
|
||||||
// import { useEcharts } from "/@/plugins/echarts";
|
// import { useEcharts } from "@/plugins/echarts";
|
||||||
// import { useTable } from "../src/plugins/vxe-table";
|
// import { useTable } from "@/plugins/vxe-table";
|
||||||
import { injectResponsiveStorage } from "/@/utils/responsive";
|
import { injectResponsiveStorage } from "@/utils/responsive";
|
||||||
|
|
||||||
// import Table from "@pureadmin/table";
|
// import Table from "@pureadmin/table";
|
||||||
// import PureDescriptions from "@pureadmin/descriptions";
|
// import PureDescriptions from "@pureadmin/descriptions";
|
||||||
@@ -29,7 +29,7 @@ import "./assets/iconfont/iconfont.css";
|
|||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
// 自定义指令
|
// 自定义指令
|
||||||
import * as directives from "/@/directives";
|
import * as directives from "@/directives";
|
||||||
Object.keys(directives).forEach(key => {
|
Object.keys(directives).forEach(key => {
|
||||||
app.directive(key, (directives as { [key: string]: Directive })[key]);
|
app.directive(key, (directives as { [key: string]: Directive })[key]);
|
||||||
});
|
});
|
||||||
@@ -45,7 +45,7 @@ app.component("IconifyIconOnline", IconifyIconOnline);
|
|||||||
app.component("FontIcon", FontIcon);
|
app.component("FontIcon", FontIcon);
|
||||||
|
|
||||||
// 全局注册按钮级别权限组件
|
// 全局注册按钮级别权限组件
|
||||||
import { Auth } from "/@/components/ReAuth";
|
import { Auth } from "@/components/ReAuth";
|
||||||
app.component("Auth", Auth);
|
app.component("Auth", Auth);
|
||||||
|
|
||||||
getServerConfig(app).then(async config => {
|
getServerConfig(app).then(async config => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import "xe-utils";
|
|||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
import XEUtils from "xe-utils";
|
import XEUtils from "xe-utils";
|
||||||
import { App, unref } from "vue";
|
import { App, unref } from "vue";
|
||||||
import { i18n } from "/@/plugins/i18n";
|
import { i18n } from "@/plugins/i18n";
|
||||||
import "font-awesome/css/font-awesome.min.css";
|
import "font-awesome/css/font-awesome.min.css";
|
||||||
import zh from "vxe-table/lib/locale/lang/zh-CN";
|
import zh from "vxe-table/lib/locale/lang/zh-CN";
|
||||||
import en from "vxe-table/lib/locale/lang/en-US";
|
import en from "vxe-table/lib/locale/lang/en-US";
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
import { toRouteType } from "./types";
|
import { toRouteType } from "./types";
|
||||||
import NProgress from "/@/utils/progress";
|
import NProgress from "@/utils/progress";
|
||||||
import { findIndex } from "lodash-unified";
|
import { findIndex } from "lodash-unified";
|
||||||
import { transformI18n } from "/@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { sessionKey, type DataInfo } from "/@/utils/auth";
|
import { sessionKey, type DataInfo } from "@/utils/auth";
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import {
|
import {
|
||||||
Router,
|
Router,
|
||||||
createRouter,
|
createRouter,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { $t } from "/@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import type { RouteConfigsTable } from "/#/index";
|
import type { RouteConfigsTable } from "/#/index";
|
||||||
|
|
||||||
const errorRouter: RouteConfigsTable = {
|
const errorRouter: RouteConfigsTable = {
|
||||||
@@ -13,7 +13,7 @@ const errorRouter: RouteConfigsTable = {
|
|||||||
{
|
{
|
||||||
path: "/error/403",
|
path: "/error/403",
|
||||||
name: "403",
|
name: "403",
|
||||||
component: () => import("/@/views/error/403.vue"),
|
component: () => import("@/views/error/403.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hsfourZeroOne")
|
title: $t("menus.hsfourZeroOne")
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ const errorRouter: RouteConfigsTable = {
|
|||||||
{
|
{
|
||||||
path: "/error/404",
|
path: "/error/404",
|
||||||
name: "404",
|
name: "404",
|
||||||
component: () => import("/@/views/error/404.vue"),
|
component: () => import("@/views/error/404.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hsfourZeroFour")
|
title: $t("menus.hsfourZeroFour")
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ const errorRouter: RouteConfigsTable = {
|
|||||||
{
|
{
|
||||||
path: "/error/500",
|
path: "/error/500",
|
||||||
name: "500",
|
name: "500",
|
||||||
component: () => import("/@/views/error/500.vue"),
|
component: () => import("@/views/error/500.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hsFive")
|
title: $t("menus.hsFive")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { $t } from "/@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import type { RouteConfigsTable } from "/#/index";
|
import type { RouteConfigsTable } from "/#/index";
|
||||||
const Layout = () => import("/@/layout/index.vue");
|
const Layout = () => import("@/layout/index.vue");
|
||||||
|
|
||||||
const homeRouter: RouteConfigsTable = {
|
const homeRouter: RouteConfigsTable = {
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -16,7 +16,7 @@ const homeRouter: RouteConfigsTable = {
|
|||||||
{
|
{
|
||||||
path: "/welcome",
|
path: "/welcome",
|
||||||
name: "Welcome",
|
name: "Welcome",
|
||||||
component: () => import("/@/views/welcome/index.vue"),
|
component: () => import("@/views/welcome/index.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hshome")
|
title: $t("menus.hshome")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { $t } from "/@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import type { RouteConfigsTable } from "/#/index";
|
import type { RouteConfigsTable } from "/#/index";
|
||||||
const Layout = () => import("/@/layout/index.vue");
|
const Layout = () => import("@/layout/index.vue");
|
||||||
|
|
||||||
const remainingRouter: Array<RouteConfigsTable> = [
|
const remainingRouter: Array<RouteConfigsTable> = [
|
||||||
{
|
{
|
||||||
path: "/login",
|
path: "/login",
|
||||||
name: "Login",
|
name: "Login",
|
||||||
component: () => import("/@/views/login/index.vue"),
|
component: () => import("@/views/login/index.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hslogin"),
|
title: $t("menus.hslogin"),
|
||||||
showLink: false,
|
showLink: false,
|
||||||
@@ -26,7 +26,7 @@ const remainingRouter: Array<RouteConfigsTable> = [
|
|||||||
{
|
{
|
||||||
path: "/redirect/:path(.*)",
|
path: "/redirect/:path(.*)",
|
||||||
name: "Redirect",
|
name: "Redirect",
|
||||||
component: () => import("/@/layout/redirect.vue")
|
component: () => import("@/layout/redirect.vue")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { router } from "./index";
|
|||||||
import { isProxy, toRaw } from "vue";
|
import { isProxy, toRaw } from "vue";
|
||||||
import { loadEnv } from "../../build";
|
import { loadEnv } from "../../build";
|
||||||
import { useTimeoutFn } from "@vueuse/core";
|
import { useTimeoutFn } from "@vueuse/core";
|
||||||
import { RouteConfigs } from "/@/layout/types";
|
import { RouteConfigs } from "@/layout/types";
|
||||||
import {
|
import {
|
||||||
isString,
|
isString,
|
||||||
storageSession,
|
storageSession,
|
||||||
@@ -18,14 +18,14 @@ import {
|
|||||||
isIncludeAllChildren
|
isIncludeAllChildren
|
||||||
} from "@pureadmin/utils";
|
} from "@pureadmin/utils";
|
||||||
import { cloneDeep, intersection } from "lodash-unified";
|
import { cloneDeep, intersection } from "lodash-unified";
|
||||||
import { sessionKey, type DataInfo } from "/@/utils/auth";
|
import { sessionKey, type DataInfo } from "@/utils/auth";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
const IFrame = () => import("/@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
// https://cn.vitejs.dev/guide/features.html#glob-import
|
// https://cn.vitejs.dev/guide/features.html#glob-import
|
||||||
const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
||||||
|
|
||||||
// 动态路由
|
// 动态路由
|
||||||
import { getAsyncRoutes } from "/@/api/routes";
|
import { getAsyncRoutes } from "@/api/routes";
|
||||||
|
|
||||||
/** 按照路由中meta下的rank等级升序来排序路由 */
|
/** 按照路由中meta下的rank等级升序来排序路由 */
|
||||||
function ascending(arr: any[]) {
|
function ascending(arr: any[]) {
|
||||||
@@ -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 {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { store } from "/@/store";
|
import { store } from "@/store";
|
||||||
import { appType } from "./types";
|
import { appType } from "./types";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
import type { StorageConfigs } from "/#/index";
|
import type { StorageConfigs } from "/#/index";
|
||||||
import { deviceDetection, storageLocal } from "@pureadmin/utils";
|
import { deviceDetection, storageLocal } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { store } from "/@/store";
|
import { store } from "@/store";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
import type { StorageConfigs } from "/#/index";
|
import type { StorageConfigs } from "/#/index";
|
||||||
import { storageLocal } from "@pureadmin/utils";
|
import { storageLocal } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { store } from "/@/store";
|
import { store } from "@/store";
|
||||||
import { isEqual } from "lodash-unified";
|
import { isEqual } from "lodash-unified";
|
||||||
import type { StorageConfigs } from "/#/index";
|
import type { StorageConfigs } from "/#/index";
|
||||||
import { routerArrays } from "/@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
import { multiType, positionType } from "./types";
|
import { multiType, positionType } from "./types";
|
||||||
import { isUrl, storageLocal } from "@pureadmin/utils";
|
import { isUrl, storageLocal } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { store } from "/@/store";
|
import { store } from "@/store";
|
||||||
import { cacheType } from "./types";
|
import { cacheType } from "./types";
|
||||||
import { constantMenus } from "/@/router";
|
import { constantMenus } from "@/router";
|
||||||
import { ascending, filterTree, filterNoPermissionTree } from "/@/router/utils";
|
import { ascending, filterTree, filterNoPermissionTree } from "@/router/utils";
|
||||||
|
|
||||||
export const usePermissionStore = defineStore({
|
export const usePermissionStore = defineStore({
|
||||||
id: "pure-permission",
|
id: "pure-permission",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { store } from "/@/store";
|
import { store } from "@/store";
|
||||||
import { setType } from "./types";
|
import { setType } from "./types";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "@/config";
|
||||||
|
|
||||||
export const useSettingStore = defineStore({
|
export const useSettingStore = defineStore({
|
||||||
id: "pure-setting",
|
id: "pure-setting",
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { store } from "/@/store";
|
import { store } from "@/store";
|
||||||
import { userType } from "./types";
|
import { userType } from "./types";
|
||||||
import { routerArrays } from "/@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
import { router, resetRouter } from "/@/router";
|
import { router, resetRouter } from "@/router";
|
||||||
import { storageSession } from "@pureadmin/utils";
|
import { storageSession } from "@pureadmin/utils";
|
||||||
import { getLogin, refreshTokenApi } from "/@/api/user";
|
import { getLogin, refreshTokenApi } from "@/api/user";
|
||||||
import { UserResult, RefreshTokenResult } from "/@/api/user";
|
import { UserResult, RefreshTokenResult } from "@/api/user";
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import {
|
import { type DataInfo, setToken, removeToken, sessionKey } from "@/utils/auth";
|
||||||
type DataInfo,
|
|
||||||
setToken,
|
|
||||||
removeToken,
|
|
||||||
sessionKey
|
|
||||||
} from "/@/utils/auth";
|
|
||||||
|
|
||||||
export const useUserStore = defineStore({
|
export const useUserStore = defineStore({
|
||||||
id: "pure-user",
|
id: "pure-user",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { storageSession } from "@pureadmin/utils";
|
import { storageSession } from "@pureadmin/utils";
|
||||||
import { useUserStoreHook } from "/@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
|
|
||||||
export interface DataInfo<T> {
|
export interface DataInfo<T> {
|
||||||
/** token */
|
/** token */
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
### Get 请求
|
### Get 请求
|
||||||
|
|
||||||
```
|
```
|
||||||
import { http } from "/@/utils/http";
|
import { http } from "@/utils/http";
|
||||||
|
|
||||||
// params传参
|
// params传参
|
||||||
http.request('get', '/xxx', { params: param });
|
http.request('get', '/xxx', { params: param });
|
||||||
@@ -15,7 +15,7 @@ http.request('get', '/xxx?message=' + msg);
|
|||||||
### Post 请求
|
### Post 请求
|
||||||
|
|
||||||
```
|
```
|
||||||
import { http } from "/@/utils/http";
|
import { http } from "@/utils/http";
|
||||||
|
|
||||||
// params传参
|
// params传参
|
||||||
http.request('post', '/xxx', { params: param });
|
http.request('post', '/xxx', { params: param });
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
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";
|
||||||
import { useUserStoreHook } from "/@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
|
|
||||||
// 加载环境变量 VITE_PROXY_DOMAIN(开发环境) VITE_PROXY_DOMAIN_REAL(打包后的线上环境)
|
// 加载环境变量 VITE_PROXY_DOMAIN(开发环境) VITE_PROXY_DOMAIN_REAL(打包后的线上环境)
|
||||||
// const { VITE_PROXY_DOMAIN, VITE_PROXY_DOMAIN_REAL } = loadEnv();
|
// const { VITE_PROXY_DOMAIN, VITE_PROXY_DOMAIN_REAL } = loadEnv();
|
||||||
@@ -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"
|
||||||
},
|
},
|
||||||
// 数组格式参数序列化
|
// 数组格式参数序列化(https://github.com/axios/axios/issues/5142)
|
||||||
paramsSerializer: params => qs.stringify(params, { indices: false })
|
paramsSerializer: {
|
||||||
|
serialize: stringify as unknown as CustomParamsSerializer
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PureHttp {
|
class PureHttp {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// 响应式storage
|
// 响应式storage
|
||||||
import { App } from "vue";
|
import { App } from "vue";
|
||||||
import Storage from "responsive-storage";
|
import Storage from "responsive-storage";
|
||||||
import { routerArrays } from "/@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
|
|
||||||
const nameSpace = "responsive-";
|
const nameSpace = "responsive-";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import noAccess from "/@/assets/status/403.svg?component";
|
import noAccess from "@/assets/status/403.svg?component";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "403"
|
name: "403"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import noExist from "/@/assets/status/404.svg?component";
|
import noExist from "@/assets/status/404.svg?component";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "404"
|
name: "404"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import noServer from "/@/assets/status/500.svg?component";
|
import noServer from "@/assets/status/500.svg?component";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "500"
|
name: "500"
|
||||||
|
|||||||
@@ -3,22 +3,22 @@ import { useI18n } from "vue-i18n";
|
|||||||
import Motion from "./utils/motion";
|
import Motion from "./utils/motion";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { loginRules } from "./utils/rule";
|
import { loginRules } from "./utils/rule";
|
||||||
import { initRouter } from "/@/router/utils";
|
import { initRouter } from "@/router/utils";
|
||||||
import { useNav } from "/@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { message } from "@pureadmin/components";
|
import { message } from "@pureadmin/components";
|
||||||
import type { FormInstance } from "element-plus";
|
import type { FormInstance } from "element-plus";
|
||||||
import { $t, transformI18n } from "/@/plugins/i18n";
|
import { $t, transformI18n } from "@/plugins/i18n";
|
||||||
import { useLayout } from "/@/layout/hooks/useLayout";
|
import { useLayout } from "@/layout/hooks/useLayout";
|
||||||
import { useUserStoreHook } from "/@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
import { bg, avatar, illustration } from "./utils/static";
|
import { bg, avatar, illustration } from "./utils/static";
|
||||||
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import { ref, reactive, toRaw, onMounted, onBeforeUnmount } from "vue";
|
import { ref, reactive, toRaw, onMounted, onBeforeUnmount } from "vue";
|
||||||
import { useTranslationLang } from "/@/layout/hooks/useTranslationLang";
|
import { useTranslationLang } from "@/layout/hooks/useTranslationLang";
|
||||||
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
|
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||||
|
|
||||||
import dayIcon from "/@/assets/svg/day.svg?component";
|
import dayIcon from "@/assets/svg/day.svg?component";
|
||||||
import darkIcon from "/@/assets/svg/dark.svg?component";
|
import darkIcon from "@/assets/svg/dark.svg?component";
|
||||||
import globalization from "/@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "Login"
|
name: "Login"
|
||||||
@@ -193,7 +193,7 @@ onBeforeUnmount(() => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@import url("/@/style/login.css");
|
@import url("@/style/login.css");
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
import type { FormRules } from "element-plus";
|
import type { FormRules } from "element-plus";
|
||||||
import { $t, transformI18n } from "/@/plugins/i18n";
|
import { $t, transformI18n } from "@/plugins/i18n";
|
||||||
|
|
||||||
/** 密码正则(密码格式应为8-18位数字、字母、符号的任意两种组合) */
|
/** 密码正则(密码格式应为8-18位数字、字母、符号的任意两种组合) */
|
||||||
export const REGEXP_PWD =
|
export const REGEXP_PWD =
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import bg from "/@/assets/login/bg.png";
|
import bg from "@/assets/login/bg.png";
|
||||||
import avatar from "/@/assets/login/avatar.svg?component";
|
import avatar from "@/assets/login/avatar.svg?component";
|
||||||
import illustration from "/@/assets/login/illustration.svg?component";
|
import illustration from "@/assets/login/illustration.svg?component";
|
||||||
|
|
||||||
export { bg, avatar, illustration };
|
export { bg, avatar, illustration };
|
||||||
|
|||||||
@@ -1,25 +1,26 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type CSSProperties, computed } from "vue";
|
import { type CSSProperties, computed } from "vue";
|
||||||
import { hasAuth, getAuths } from "/@/router/utils";
|
import { hasAuth, getAuths } from "@/router/utils";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "PermissionButton"
|
name: "PermissionButton"
|
||||||
});
|
});
|
||||||
|
|
||||||
let width = computed((): CSSProperties => {
|
let elStyle = computed((): CSSProperties => {
|
||||||
return {
|
return {
|
||||||
width: "85vw"
|
width: "85vw",
|
||||||
|
justifyContent: "start"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-space direction="vertical" size="large">
|
<el-space direction="vertical" size="large">
|
||||||
<el-tag :style="width" size="large" effect="dark">
|
<el-tag :style="elStyle" size="large" effect="dark">
|
||||||
当前拥有的code列表:{{ getAuths() }}
|
当前拥有的code列表:{{ getAuths() }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
|
||||||
<el-card shadow="never" :style="width">
|
<el-card shadow="never" :style="elStyle">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">组件方式判断权限</div>
|
<div class="card-header">组件方式判断权限</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,7 +37,7 @@ let width = computed((): CSSProperties => {
|
|||||||
</Auth>
|
</Auth>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never" :style="width">
|
<el-card shadow="never" :style="elStyle">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">函数方式判断权限</div>
|
<div class="card-header">函数方式判断权限</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -54,7 +55,7 @@ let width = computed((): CSSProperties => {
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never" :style="width">
|
<el-card shadow="never" :style="elStyle">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
指令方式判断权限(该方式不能动态修改权限)
|
指令方式判断权限(该方式不能动态修改权限)
|
||||||
@@ -72,9 +73,3 @@ let width = computed((): CSSProperties => {
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-space>
|
</el-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
:deep(.el-tag) {
|
|
||||||
justify-content: start;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { initRouter } from "/@/router/utils";
|
import { initRouter } from "@/router/utils";
|
||||||
import { type CSSProperties, ref, computed } from "vue";
|
import { type CSSProperties, ref, computed } from "vue";
|
||||||
import { useUserStoreHook } from "/@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "PermissionPage"
|
name: "PermissionPage"
|
||||||
});
|
});
|
||||||
|
|
||||||
let width = computed((): CSSProperties => {
|
let elStyle = computed((): CSSProperties => {
|
||||||
return {
|
return {
|
||||||
width: "85vw"
|
width: "85vw",
|
||||||
|
justifyContent: "start"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -41,10 +42,10 @@ function onChange() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-space direction="vertical" size="large">
|
<el-space direction="vertical" size="large">
|
||||||
<el-tag :style="width" size="large" effect="dark">
|
<el-tag :style="elStyle" size="large" effect="dark">
|
||||||
模拟后台根据不同角色返回对应路由(具体参考完整版pure-admin代码)
|
模拟后台根据不同角色返回对应路由(具体参考完整版pure-admin代码)
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-card shadow="never" :style="width">
|
<el-card shadow="never" :style="elStyle">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>当前角色:{{ username }}</span>
|
<span>当前角色:{{ username }}</span>
|
||||||
@@ -61,9 +62,3 @@ function onChange() {
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-space>
|
</el-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
:deep(.el-tag) {
|
|
||||||
justify-content: start;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"lib": ["dom", "esnext"],
|
"lib": ["dom", "esnext"],
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"/@/*": ["src/*"],
|
"@/*": ["src/*"],
|
||||||
"@build/*": ["build/*"],
|
"@build/*": ["build/*"],
|
||||||
"/#/*": ["types/*"]
|
"/#/*": ["types/*"]
|
||||||
},
|
},
|
||||||
|
|||||||
11
types/global.d.ts
vendored
11
types/global.d.ts
vendored
@@ -74,6 +74,15 @@ declare global {
|
|||||||
__: unknown;
|
__: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ViteCompression =
|
||||||
|
| "none"
|
||||||
|
| "gzip"
|
||||||
|
| "brotli"
|
||||||
|
| "both"
|
||||||
|
| "gzip-clear"
|
||||||
|
| "brotli-clear"
|
||||||
|
| "both-clear";
|
||||||
|
|
||||||
declare interface ViteEnv {
|
declare interface ViteEnv {
|
||||||
VITE_PORT: number;
|
VITE_PORT: number;
|
||||||
VITE_PUBLIC_PATH: string;
|
VITE_PUBLIC_PATH: string;
|
||||||
@@ -81,6 +90,8 @@ declare global {
|
|||||||
VITE_PROXY_DOMAIN_REAL: string;
|
VITE_PROXY_DOMAIN_REAL: string;
|
||||||
VITE_ROUTER_HISTORY: string;
|
VITE_ROUTER_HISTORY: string;
|
||||||
VITE_LEGACY: boolean;
|
VITE_LEGACY: boolean;
|
||||||
|
VITE_CDN: boolean;
|
||||||
|
VITE_COMPRESSION: ViteCompression;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare interface ServerConfigs {
|
declare interface ServerConfigs {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const pathResolve = (dir: string): string => {
|
|||||||
|
|
||||||
/** 设置别名 */
|
/** 设置别名 */
|
||||||
const alias: Record<string, string> = {
|
const alias: Record<string, string> = {
|
||||||
"/@": pathResolve("src"),
|
"@": pathResolve("src"),
|
||||||
"@build": pathResolve("build")
|
"@build": pathResolve("build")
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -27,8 +27,10 @@ const __APP_INFO__ = {
|
|||||||
|
|
||||||
export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
||||||
const {
|
const {
|
||||||
|
VITE_CDN,
|
||||||
VITE_PORT,
|
VITE_PORT,
|
||||||
VITE_LEGACY,
|
VITE_LEGACY,
|
||||||
|
VITE_COMPRESSION,
|
||||||
VITE_PUBLIC_PATH,
|
VITE_PUBLIC_PATH,
|
||||||
VITE_PROXY_DOMAIN,
|
VITE_PROXY_DOMAIN,
|
||||||
VITE_PROXY_DOMAIN_REAL
|
VITE_PROXY_DOMAIN_REAL
|
||||||
@@ -59,7 +61,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
|||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
},
|
},
|
||||||
plugins: getPluginsList(command, VITE_LEGACY),
|
plugins: getPluginsList(command, VITE_LEGACY, VITE_CDN, VITE_COMPRESSION),
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ["pinia", "vue-i18n", "lodash-es", "@vueuse/core", "dayjs"],
|
include: ["pinia", "vue-i18n", "lodash-es", "@vueuse/core", "dayjs"],
|
||||||
exclude: ["@pureadmin/theme/dist/browser-utils"]
|
exclude: ["@pureadmin/theme/dist/browser-utils"]
|
||||||
|
|||||||
Reference in New Issue
Block a user