From 5511769673194a0f6685f98c3975f7045e883eb4 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 12 Oct 2023 16:36:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/env/.env | 3 +- ui/index.html | 2 +- ui/package-lock.json | 341 +++++++++++++++++- ui/package.json | 3 +- ui/src/common/permission/index.ts | 4 + ui/src/components/icons/AppIcon.vue | 1 + ui/src/components/index.ts | 12 + .../layout/home-layout}/index.vue | 0 .../layout/login-container/index.vue | 48 +++ .../components/layout/login-layout/index.vue | 94 ++--- ui/src/components/layout/top-bar/index.vue | 15 +- ui/src/directives/hasPermission.ts | 4 +- ui/src/main.ts | 12 +- ui/src/router/data.ts | 10 +- ui/src/styles/app.scss | 153 +++++--- ui/src/styles/drawer.scss | 21 -- ui/src/styles/element-plus.scss | 22 +- ui/src/styles/index.scss | 11 +- ui/src/styles/mixins.scss | 15 - .../{variables/app.scss => variables.scss} | 4 + ui/src/styles/variables/header.scss | 6 - ui/src/styles/variables/index.scss | 2 - ui/src/views/forgot-password/index.vue | 169 --------- ui/src/views/login/forgot-password/index.vue | 119 ++++++ ui/src/views/login/index.scss | 4 + ui/src/views/login/index.vue | 220 +++++------ ui/src/views/login/register/index.vue | 203 +++++++++++ ui/src/views/login/reset-password/index.vue | 137 +++++++ ui/src/views/register/index.vue | 236 ------------ ui/src/views/reset-password/index.vue | 183 ---------- ui/vite.config.ts | 6 +- 31 files changed, 1149 insertions(+), 911 deletions(-) create mode 100644 ui/src/components/index.ts rename ui/src/{views/home => components/layout/home-layout}/index.vue (100%) create mode 100644 ui/src/components/layout/login-container/index.vue delete mode 100644 ui/src/styles/drawer.scss delete mode 100644 ui/src/styles/mixins.scss rename ui/src/styles/{variables/app.scss => variables.scss} (68%) delete mode 100644 ui/src/styles/variables/header.scss delete mode 100644 ui/src/styles/variables/index.scss delete mode 100644 ui/src/views/forgot-password/index.vue create mode 100644 ui/src/views/login/forgot-password/index.vue create mode 100644 ui/src/views/login/index.scss create mode 100644 ui/src/views/login/register/index.vue create mode 100644 ui/src/views/login/reset-password/index.vue delete mode 100644 ui/src/views/register/index.vue delete mode 100644 ui/src/views/reset-password/index.vue diff --git a/ui/env/.env b/ui/env/.env index 522c7de68..4dcc347bb 100644 --- a/ui/env/.env +++ b/ui/env/.env @@ -1,3 +1,4 @@ VITE_APP_NAME=ui VITE_BASE_PATH=/ui/ -VITE_APP_PORT=3000 \ No newline at end of file +VITE_APP_PORT=3000 +VITE_APP_TITLE = '智能知识库' \ No newline at end of file diff --git a/ui/index.html b/ui/index.html index a88854489..c6b14cc72 100644 --- a/ui/index.html +++ b/ui/index.html @@ -4,7 +4,7 @@ - Vite App + %VITE_APP_TITLE%
diff --git a/ui/package-lock.json b/ui/package-lock.json index 1abc821ab..0ccfcde45 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "axios": "^0.27.2", - "element-plus": "^2.3.7", + "element-plus": "^2.3.14", "lodash": "^4.17.21", "nprogress": "^0.2.0", "pinia": "^2.1.6", @@ -34,6 +34,7 @@ "prettier": "^3.0.0", "sass": "^1.66.1", "typescript": "~5.1.6", + "unplugin-vue-define-options": "^1.3.18", "vite": "^4.4.9", "vitest": "^0.34.2", "vue-tsc": "^1.8.8" @@ -48,6 +49,24 @@ "node": ">=0.10.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/parser": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.15.tgz", @@ -59,6 +78,20 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@ctrl/tinycolor": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", @@ -290,6 +323,28 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@rollup/pluginutils": { + "version": "5.0.5", + "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", + "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rushstack/eslint-patch": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.3.tgz", @@ -332,6 +387,12 @@ "@types/chai": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.2.tgz", + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==", + "dev": true + }, "node_modules/@types/jsdom": { "version": "21.1.2", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.2.tgz", @@ -714,6 +775,31 @@ "@volar/language-core": "1.10.1" } }, + "node_modules/@vue-macros/common": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@vue-macros/common/-/common-1.8.0.tgz", + "integrity": "sha512-auDJJzE0z3uRe3867e0DsqcseKImktNf5ojCZgUKqiVxb2yTlwlgOVAYCgoep9oITqxkXQymSvFeKhedi8PhaA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.17", + "@rollup/pluginutils": "^5.0.4", + "@vue/compiler-sfc": "^3.3.4", + "ast-kit": "^0.11.2", + "local-pkg": "^0.4.3", + "magic-string-ast": "^0.3.0" + }, + "engines": { + "node": ">=16.14.0" + }, + "peerDependencies": { + "vue": "^2.7.0 || ^3.2.25" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } + } + }, "node_modules/@vue/compiler-core": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", @@ -1189,6 +1275,47 @@ "node": "*" } }, + "node_modules/ast-kit": { + "version": "0.11.2", + "resolved": "https://registry.npmmirror.com/ast-kit/-/ast-kit-0.11.2.tgz", + "integrity": "sha512-Q0DjXK4ApbVoIf9GLyCo252tUH44iTnD/hiJ2TQaJeydYWSpKk0sI34+WMel8S9Wt5pbLgG02oJ+gkgX5DV3sQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.22.14", + "@rollup/pluginutils": "^5.0.4", + "pathe": "^1.1.1" + }, + "engines": { + "node": ">=16.14.0" + } + }, + "node_modules/ast-walker-scope": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/ast-walker-scope/-/ast-walker-scope-0.5.0.tgz", + "integrity": "sha512-NsyHMxBh4dmdEHjBo1/TBZvCKxffmZxRYhmclfu0PP6Aftre47jOHYaYaNqJcV0bxihxFXhDkzLHUwHc0ocd0Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.22.7", + "ast-kit": "^0.9.4" + }, + "engines": { + "node": ">=16.14.0" + } + }, + "node_modules/ast-walker-scope/node_modules/ast-kit": { + "version": "0.9.5", + "resolved": "https://registry.npmmirror.com/ast-kit/-/ast-kit-0.9.5.tgz", + "integrity": "sha512-kbL7ERlqjXubdDd+szuwdlQ1xUxEz9mCz1+m07ftNVStgwRb2RWw+U6oKo08PAvOishMxiqz1mlJyLl8yQx2Qg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.22.7", + "@rollup/pluginutils": "^5.0.2", + "pathe": "^1.1.1" + }, + "engines": { + "node": ">=16.14.0" + } + }, "node_modules/async-validator": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.2.5.tgz", @@ -1733,9 +1860,9 @@ } }, "node_modules/element-plus": { - "version": "2.3.12", - "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.3.12.tgz", - "integrity": "sha512-fAWpbKCyt+l1dsqSNPOs/F/dBN4Wp5CGAyxbiS5zqDwI4q3QPM+LxLU2h3GUHMIBtMGCvmsG98j5HPMkTKkvcA==", + "version": "2.3.14", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.3.14.tgz", + "integrity": "sha512-9yvxUaU4jXf2ZNPdmIxoj/f8BG8CDcGM6oHa9JIqxLjQlfY4bpzR1E5CjNimnOX3rxO93w1TQ0jTVt0RSxh9kA==", "dependencies": { "@ctrl/tinycolor": "^3.4.1", "@element-plus/icons-vue": "^2.0.6", @@ -3378,6 +3505,18 @@ "node": ">=12" } }, + "node_modules/magic-string-ast": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/magic-string-ast/-/magic-string-ast-0.3.0.tgz", + "integrity": "sha512-0shqecEPgdFpnI3AP90epXyxZy9g6CRZ+SZ7BcqFwYmtFEnZ1jpevcV5HoyVnlDS9gCnc1UIg3Rsvp3Ci7r8OA==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.2" + }, + "engines": { + "node": ">=16.14.0" + } + }, "node_modules/memoize-one": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", @@ -4945,6 +5084,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5152,6 +5300,32 @@ "node": ">= 4.0.0" } }, + "node_modules/unplugin": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.5.0.tgz", + "integrity": "sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0", + "chokidar": "^3.5.3", + "webpack-sources": "^3.2.3", + "webpack-virtual-modules": "^0.5.0" + } + }, + "node_modules/unplugin-vue-define-options": { + "version": "1.3.18", + "resolved": "https://registry.npmmirror.com/unplugin-vue-define-options/-/unplugin-vue-define-options-1.3.18.tgz", + "integrity": "sha512-AaE10FCccfezT48yyYuUXdnTF9z8vQuXrlpNF5uQtq/AOD2pdkf38vnmJm8bJjpoqEkR6u72wNCJLZKXSUw+Og==", + "dev": true, + "dependencies": { + "@vue-macros/common": "1.8.0", + "ast-walker-scope": "^0.5.0", + "unplugin": "^1.4.0" + }, + "engines": { + "node": ">=16.14.0" + } + }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", @@ -5480,6 +5654,21 @@ "node": ">=12" } }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack-virtual-modules": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz", + "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==", + "dev": true + }, "node_modules/whatwg-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", @@ -5648,11 +5837,34 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true + }, "@babel/parser": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.15.tgz", "integrity": "sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA==" }, + "@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + } + }, "@ctrl/tinycolor": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", @@ -5819,6 +6031,17 @@ "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" }, + "@rollup/pluginutils": { + "version": "5.0.5", + "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", + "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + } + }, "@rushstack/eslint-patch": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.3.tgz", @@ -5858,6 +6081,12 @@ "@types/chai": "*" } }, + "@types/estree": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.2.tgz", + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==", + "dev": true + }, "@types/jsdom": { "version": "21.1.2", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.2.tgz", @@ -6120,6 +6349,20 @@ "@volar/language-core": "1.10.1" } }, + "@vue-macros/common": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@vue-macros/common/-/common-1.8.0.tgz", + "integrity": "sha512-auDJJzE0z3uRe3867e0DsqcseKImktNf5ojCZgUKqiVxb2yTlwlgOVAYCgoep9oITqxkXQymSvFeKhedi8PhaA==", + "dev": true, + "requires": { + "@babel/types": "^7.22.17", + "@rollup/pluginutils": "^5.0.4", + "@vue/compiler-sfc": "^3.3.4", + "ast-kit": "^0.11.2", + "local-pkg": "^0.4.3", + "magic-string-ast": "^0.3.0" + } + }, "@vue/compiler-core": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", @@ -6466,6 +6709,40 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "ast-kit": { + "version": "0.11.2", + "resolved": "https://registry.npmmirror.com/ast-kit/-/ast-kit-0.11.2.tgz", + "integrity": "sha512-Q0DjXK4ApbVoIf9GLyCo252tUH44iTnD/hiJ2TQaJeydYWSpKk0sI34+WMel8S9Wt5pbLgG02oJ+gkgX5DV3sQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.22.14", + "@rollup/pluginutils": "^5.0.4", + "pathe": "^1.1.1" + } + }, + "ast-walker-scope": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/ast-walker-scope/-/ast-walker-scope-0.5.0.tgz", + "integrity": "sha512-NsyHMxBh4dmdEHjBo1/TBZvCKxffmZxRYhmclfu0PP6Aftre47jOHYaYaNqJcV0bxihxFXhDkzLHUwHc0ocd0Q==", + "dev": true, + "requires": { + "@babel/parser": "^7.22.7", + "ast-kit": "^0.9.4" + }, + "dependencies": { + "ast-kit": { + "version": "0.9.5", + "resolved": "https://registry.npmmirror.com/ast-kit/-/ast-kit-0.9.5.tgz", + "integrity": "sha512-kbL7ERlqjXubdDd+szuwdlQ1xUxEz9mCz1+m07ftNVStgwRb2RWw+U6oKo08PAvOishMxiqz1mlJyLl8yQx2Qg==", + "dev": true, + "requires": { + "@babel/parser": "^7.22.7", + "@rollup/pluginutils": "^5.0.2", + "pathe": "^1.1.1" + } + } + } + }, "async-validator": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.2.5.tgz", @@ -6869,9 +7146,9 @@ } }, "element-plus": { - "version": "2.3.12", - "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.3.12.tgz", - "integrity": "sha512-fAWpbKCyt+l1dsqSNPOs/F/dBN4Wp5CGAyxbiS5zqDwI4q3QPM+LxLU2h3GUHMIBtMGCvmsG98j5HPMkTKkvcA==", + "version": "2.3.14", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.3.14.tgz", + "integrity": "sha512-9yvxUaU4jXf2ZNPdmIxoj/f8BG8CDcGM6oHa9JIqxLjQlfY4bpzR1E5CjNimnOX3rxO93w1TQ0jTVt0RSxh9kA==", "requires": { "@ctrl/tinycolor": "^3.4.1", "@element-plus/icons-vue": "^2.0.6", @@ -8064,6 +8341,15 @@ "@jridgewell/sourcemap-codec": "^1.4.15" } }, + "magic-string-ast": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/magic-string-ast/-/magic-string-ast-0.3.0.tgz", + "integrity": "sha512-0shqecEPgdFpnI3AP90epXyxZy9g6CRZ+SZ7BcqFwYmtFEnZ1jpevcV5HoyVnlDS9gCnc1UIg3Rsvp3Ci7r8OA==", + "dev": true, + "requires": { + "magic-string": "^0.30.2" + } + }, "memoize-one": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", @@ -9164,6 +9450,12 @@ "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", "dev": true }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -9315,6 +9607,29 @@ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, + "unplugin": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.5.0.tgz", + "integrity": "sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==", + "dev": true, + "requires": { + "acorn": "^8.10.0", + "chokidar": "^3.5.3", + "webpack-sources": "^3.2.3", + "webpack-virtual-modules": "^0.5.0" + } + }, + "unplugin-vue-define-options": { + "version": "1.3.18", + "resolved": "https://registry.npmmirror.com/unplugin-vue-define-options/-/unplugin-vue-define-options-1.3.18.tgz", + "integrity": "sha512-AaE10FCccfezT48yyYuUXdnTF9z8vQuXrlpNF5uQtq/AOD2pdkf38vnmJm8bJjpoqEkR6u72wNCJLZKXSUw+Og==", + "dev": true, + "requires": { + "@vue-macros/common": "1.8.0", + "ast-walker-scope": "^0.5.0", + "unplugin": "^1.4.0" + } + }, "untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", @@ -9509,6 +9824,18 @@ "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true }, + "webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true + }, + "webpack-virtual-modules": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz", + "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==", + "dev": true + }, "whatwg-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", diff --git a/ui/package.json b/ui/package.json index 8f241664f..2798d011a 100644 --- a/ui/package.json +++ b/ui/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "axios": "^0.27.2", - "element-plus": "^2.3.7", + "element-plus": "^2.3.14", "lodash": "^4.17.21", "nprogress": "^0.2.0", "pinia": "^2.1.6", @@ -39,6 +39,7 @@ "prettier": "^3.0.0", "sass": "^1.66.1", "typescript": "~5.1.6", + "unplugin-vue-define-options": "^1.3.18", "vite": "^4.4.9", "vitest": "^0.34.2", "vue-tsc": "^1.8.8" diff --git a/ui/src/common/permission/index.ts b/ui/src/common/permission/index.ts index 1bf099209..123d20406 100644 --- a/ui/src/common/permission/index.ts +++ b/ui/src/common/permission/index.ts @@ -10,6 +10,9 @@ const hasPermissionChild = (permission: Role | string | Permission | ComplexPerm const userStore = useUserStore(store) const permissions = userStore.getPermissions() const role = userStore.getRole() + if (!permission) { + return true + } if (permission instanceof Role) { return role === permission.role } @@ -24,6 +27,7 @@ const hasPermissionChild = (permission: Role | string | Permission | ComplexPerm if (typeof permission === 'string') { return permissions.includes(permission) } + return false } /** diff --git a/ui/src/components/icons/AppIcon.vue b/ui/src/components/icons/AppIcon.vue index d7e5da835..8ff1d5de7 100644 --- a/ui/src/components/icons/AppIcon.vue +++ b/ui/src/components/icons/AppIcon.vue @@ -4,6 +4,7 @@ + diff --git a/ui/src/components/layout/login-layout/index.vue b/ui/src/components/layout/login-layout/index.vue index a0458cc74..87d83ed9d 100644 --- a/ui/src/components/layout/login-layout/index.vue +++ b/ui/src/components/layout/login-layout/index.vue @@ -1,66 +1,48 @@ diff --git a/ui/src/components/layout/top-bar/index.vue b/ui/src/components/layout/top-bar/index.vue index d02edba6d..3c5c49122 100644 --- a/ui/src/components/layout/top-bar/index.vue +++ b/ui/src/components/layout/top-bar/index.vue @@ -2,7 +2,7 @@
-
智能客服
+
{{ defaultTitle }}
@@ -15,8 +15,9 @@
diff --git a/ui/src/views/login/forgot-password/index.vue b/ui/src/views/login/forgot-password/index.vue new file mode 100644 index 000000000..e04980990 --- /dev/null +++ b/ui/src/views/login/forgot-password/index.vue @@ -0,0 +1,119 @@ + + + diff --git a/ui/src/views/login/index.scss b/ui/src/views/login/index.scss new file mode 100644 index 000000000..899919730 --- /dev/null +++ b/ui/src/views/login/index.scss @@ -0,0 +1,4 @@ +.login-submit-button { + margin-top: 12px; + height: 40px; +} diff --git a/ui/src/views/login/index.vue b/ui/src/views/login/index.vue index e690098f5..4205ef000 100644 --- a/ui/src/views/login/index.vue +++ b/ui/src/views/login/index.vue @@ -1,152 +1,102 @@ diff --git a/ui/src/views/login/register/index.vue b/ui/src/views/login/register/index.vue new file mode 100644 index 000000000..8e4a8a8df --- /dev/null +++ b/ui/src/views/login/register/index.vue @@ -0,0 +1,203 @@ + + + diff --git a/ui/src/views/login/reset-password/index.vue b/ui/src/views/login/reset-password/index.vue new file mode 100644 index 000000000..b41ee71ed --- /dev/null +++ b/ui/src/views/login/reset-password/index.vue @@ -0,0 +1,137 @@ + + + diff --git a/ui/src/views/register/index.vue b/ui/src/views/register/index.vue deleted file mode 100644 index c9f8dacef..000000000 --- a/ui/src/views/register/index.vue +++ /dev/null @@ -1,236 +0,0 @@ - - - diff --git a/ui/src/views/reset-password/index.vue b/ui/src/views/reset-password/index.vue deleted file mode 100644 index a5a156e9f..000000000 --- a/ui/src/views/reset-password/index.vue +++ /dev/null @@ -1,183 +0,0 @@ - - - diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 5e5d9bb93..36a2935ab 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -1,7 +1,10 @@ import { fileURLToPath, URL } from 'node:url' import type { ProxyOptions } from 'vite' import { defineConfig, loadEnv } from 'vite' + import vue from '@vitejs/plugin-vue' +import DefineOptions from 'unplugin-vue-define-options/vite' + const envDir = './env' // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { @@ -13,10 +16,11 @@ export default defineConfig(({ mode }) => { rewrite: (path) => path.replace(ENV.VITE_BASE_PATH, '/') } return { + preflight: false, lintOnSave: false, base: ENV.VITE_BASE_PATH, envDir: envDir, - plugins: [vue()], + plugins: [vue(), DefineOptions()], server: { cors: true, host: '0.0.0.0',