初版提交
Some checks failed
Deploy to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled

This commit is contained in:
2025-09-09 13:35:24 +08:00
parent c2c3237369
commit 77a83e363a
453 changed files with 34080 additions and 18016 deletions

5
.browserslistrc Normal file
View File

@ -0,0 +1,5 @@
# 支持浏览器配置
> 1%
last 2 versions
not dead

View File

@ -1,14 +1,14 @@
# https://editorconfig.org
# 编辑器配置
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

View File

@ -1,8 +0,0 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'https://eladmin.vip'
VUE_APP_WS_API = 'https://eladmin.vip'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -1,7 +0,0 @@
ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'https://eladmin.vip'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://eladmin.vip'

View File

@ -1,4 +1,7 @@
build/*.js
src/assets
src/icons
public
dist
node_modules
vab-icon
layouts

View File

@ -1,198 +1,123 @@
/**
* @author https://github.com/zxwk1998/vue-admin-better 不想保留author可删除
* @description .eslintrc.js
*/
module.exports = {
root: true,
env: {
node: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended', '@vue/prettier'],
rules: {
'no-undef': 'off',
'no-console': 'off',
'no-debugger': 'off',
'prettier/prettier': 'warn',
'prefer-template': 'error',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'vue/no-reserved-component-names': 'off',
'vue/no-v-html': 'off',
'no-unused-vars': 'off',
'vue/no-useless-template-attributes': 'off',
'use-isnan': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'any',
normal: 'any',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
registeredComponentsOnly: false,
ignores: [],
},
],
// 多字组件名称
'vue/multi-word-component-names': 'off',
// Vue组件排序
'vue/order-in-components': [
'warn',
{
order: [
'el',
'name',
'key',
'parent',
'functional',
['delimiters', 'comments'],
['components', 'directives', 'filters'],
'extends',
'mixins',
['provide', 'inject'],
'ROUTER_GUARDS',
'layout',
'middleware',
'validate',
'scrollToTop',
'transition',
'loading',
'inheritAttrs',
'model',
['props', 'propsData'],
'emits',
'setup',
'fetch',
'asyncData',
'data',
'head',
'computed',
'watch',
'watchQuery',
'LIFECYCLE_HOOKS',
'methods',
['template', 'render'],
'renderError',
],
},
],
// Vue属性排序
'vue/attributes-order': [
'warn',
{
order: [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
'UNIQUE',
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT',
],
alphabetical: true, //字母顺序
},
],
},
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [2, {
"singleline": 10,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
overrides: [
{
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
env: {
jest: true,
},
},
],
}

14
.gitattributes vendored Normal file
View File

@ -0,0 +1,14 @@
# .gitattributes
*.html text eol=lf
*.css text eol=lf
*.js text eol=lf
*.scss text eol=lf
*.vue text eol=lf
*.hbs text eol=lf
*.sh text eol=lf
*.md text eol=lf
*.json text eol=lf
*.yml text eol=lf
.browserslistrc text eol=lf
.gitignore text eol=lf
*.js linguist-language=vue

37
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Deploy to GitHub Pages
on:
push:
branches:
- master
- main
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages

32
.gitignore vendored
View File

@ -1,24 +1,26 @@
# .gitignore
.DS_Store
node_modules/
dist/
demo/
node_modules
dist
.env.local
.env.*.local
npm-debug.log*
yarn.lock
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
*.sw?
public/video
*.zip
*.7z
/src/layouts/components/layouts
/zx-templates
/package-lock.json
/src/styles/themes/green.scss
/src/styles/themes/dark.scss
/src/styles/themes/glory.scss
/.history

7
.stylelintrc.js Normal file
View File

@ -0,0 +1,7 @@
/**
* @author https://github.com/zxwk1998/vue-admin-better 不想保留author可删除
* @description stylelint
*/
module.exports = {
extends: ['stylelint-config-recess-order', 'stylelint-config-prettier'],
}

View File

@ -1,5 +0,0 @@
language: node_js
node_js: 10
script: npm run test
notifications:
email: false

54
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,54 @@
{
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.quickSuggestions": {
"strings": true
},
"workbench.colorTheme": "One Monokai",
"editor.tabSize": 2,
"editor.detectIndentation": false,
"emmet.triggerExpansionOnTab": true,
"editor.formatOnSave": true,
"javascript.format.enable": true,
"git.enableSmartCommit": true,
"git.autofetch": true,
"git.confirmSync": false,
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"liveServer.settings.donotShowInfoMsg": true,
"explorer.confirmDelete": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"files.exclude": {
"**/.idea": true
},
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit",
"source.fixAll.eslint": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.suggest.snippetsPreventQuickSuggestions": false,
"prettier.htmlWhitespaceSensitivity": "ignore",
"prettier.vueIndentScriptAndStyle": true,
"docthis.authorName": "https://vuejs-core.cn",
"docthis.includeAuthorTag": true,
"docthis.includeDescriptionTag": true,
"docthis.enableHungarianNotationEvaluation": true,
"docthis.inferTypesFromNames": true,
"vetur.format.defaultFormatter.html": "prettier",
"files.autoSave": "onFocusChange",
"path-intellisense.mappings": {
"@": "${workspaceRoot}/src"
},
"files.eol": "\n"
}

204
LICENSE
View File

@ -1,191 +1,21 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
MIT License
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Copyright (c) 2020 good luck
1. Definitions.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "{}" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright 2019 Zheng Jie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

203
README.en.md Normal file
View File

@ -0,0 +1,203 @@
[简体中文](./README.md) | English
<div align="center"><img width="200" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/logo/vab.png"/>
<h1> vue-admin-betterelement-ui </h1>
<p>The flying snow all over the sky is a flying note, playing out expectations with blessings. May the epidemic dissipate as soon as possible, may you no longer have regrets next year, may you be warm in winter, may you not be cold in spring, and may you have lights in the dark and an umbrella in the rain.
</p>
</div>
[![stars](https://img.shields.io/github/stars/zxwk1998/vue-admin-better?style=flat-square&logo=GitHub)](https://github.com/zxwk1998/vue-admin-better)
[![star](https://gitee.com/chu1204505056/vue-admin-better/badge/star.svg?theme=gray)](https://gitee.com/chu1204505056/vue-admin-better)
[![license](https://img.shields.io/github/license/zxwk1998/vue-admin-better?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
---
# 🎉 Characteristic
- 💪 40 + high quality single page
- 💅 RBAC model + JWT permission control
- 🌍 100000 + practical application of the project
- 👏 Good type definition
- 🥳 The open source version supports free commercial use
- 🚀 Cross platform PC, mobile terminal and tablet
- 📦 Back end route dynamic rendering
## 🌐 Address
- [🎉 Vue2. X + element UI (free commercial, PC, tablet and mobile phone supported)](https://vuejs-core.cn/vue-admin-better/)
<!-- - [⚡️ Vue3. X + element plus (alpha version, free commercial, supporting PC, tablet and mobile phone)](https://vuejs-core.cn/vue-admin-better-plus/) -->
<!-- - [⚡️ Vue3. X + ant design Vue (beta version, free commercial, supporting PC, tablet and mobile phone)](https://vuejs-core.cn/vue-admin-better-antdv/) -->
- [⚡️ vue3.x + vite + vue-admin-arco](https://vuejs-core.cn/vue-admin-arco/)
- [🚀 Admin Pro demo address (vue2.x paid version, supporting PC, tablet and mobile phone)](https://vuejs-core.cn/admin-pro/)
- [🚀 Admin plus demo address (vue3.x paid version, supporting PC, tablet and mobile phone)](https://vuejs-core.cn/admin-plus/)
- [📌 Pro and plus purchase address authorization](https://vuejs-core.cn/authorization/)
- [🌐 Github Warehouse address](https://github.com/zxwk1998/vue-admin-better/)
- [🌐 Gitee Warehouse address](https://gitee.com/chu1204505056/vue-admin-better/)
- Recently, the VAB official website has been frequently attacked by DDoS. We have taken relevant preventive measures.
If the website cannot be accessed, please visit the backup address
## 📦️ Desktop applications
- [Admin Pro](https://gitee.com/chu1204505056/microsoft-store/raw/master/AdminPlus.zip)
- [Admin Plus](https://gitee.com/chu1204505056/microsoft-store/raw/master/AdminPlus.zip)
<!-- ## 🌱 Vue3.x vue3.0-antdv [Click switch branch](https://github.com/zxwk1998/vue-admin-better/tree/vue3.0-antdv)
```bash
git clone -b vue3.0-antdv https://github.com/zxwk1998/vue-admin-better.git
npm i --registry=http://mirrors.cloud.tencent.com/npm/
npm run serve
``` -->
## 🌱 Vue2.xmain [Click switch branch](https://github.com/zxwk1998/vue-admin-better/tree/master)
```bash
git clone -b master https://github.com/zxwk1998/vue-admin-better.git
npm i --registry=http://mirrors.cloud.tencent.com/npm/
npm run serve
```
## 🍻 Front end discussion QQ group
- Let's have a cup of coffee, and then contact QQ 783963206 to invite you to the discussion group. Because of the large
number of users, if you haven't passed a friend's request, please contact Alipay on the Alipay payment page, whether
you invite or not, you can enjoy the open source code, thank you for your support and trust, and provide the
vue-admin-better basic version in the group. Automatic configuration tutorial of development tools and project
development documents.
<table>
<tr>
<!-- <td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/qq_group/hbm.jpg">
</td> -->
<td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/zfb_kf.jpg">
</td>
<td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/qq_group/vab-2.jpg">
</td>
<td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/qq_group/vab-3.jpg">
</td>
</tr>
</table>
## 🙈 We promise to sponsor open source projects regularly (thank giant)
<a title="vue" href="https://opencollective.com/vuejs" target="_blank">
<img width="64px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/vue.png"/>
</a>
<a title="element-plus" href="https://opencollective.com/element-plus" target="_blank">
<img width="64px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/element-plus.png"/>
</a>
<a title="ant-design-vue" href="https://opencollective.com/ant-design-vue" target="_blank">
<img width="64px" src="https://images.opencollective.com/ant-design-vue/2ec179b/logo/256.png"/>
</a>
## 🎨 Acknowledge
| Project |
| ---------------------------------------------------------------- |
| [vue](https://github.com/vuejs/vue) |
| [element-ui](https://github.com/ElemeFE/element) |
| [element-plus](https://github.com/element-plus/element-plus) |
| [ant-design-vue](https://github.com/vueComponent/ant-design-vue) |
| [mock](https://github.com/nuysoft/Mock) |
| [axios](https://github.com/axios/axios) |
## 👷 Outstanding contributors to the framework (in no order)
<a href="https://github.com/buuing" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/36689704?s=50"/>
</a>
<a href="https://github.com/hipi" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/22478003?s=50"/>
</a>
<a href="https://github.com/fwfmiao" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/29328241?s=50"/>
</a>
<a href="https://github.com/hdtopku" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/14859466?s=50"/>
</a>
<a href="https://github.com/shaonialife" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/16135960?s=50"/>
</a>
## 📌 Advantages and precautions
```
Compared with other open source admin frameworks, it has the following advantages:
1. Support the front-end control routing permission intelligence and the back-end control routing permission all mode
2. It is known that the open source Vue admin framework is the first to support the automatic generation and export function of mock
3. More than 50 global fine configurations are provided
4. Support SCSS automatic sorting and eslint automatic repair
5. Axios fine encapsulation supports multiple data sources, multiple successful code arrays, and application / JSON; charset=UTF-8、application/x-www-form-urlencoded; Charset = UTF-8 multiple parameter transfer modes
6. Support login RSA encryption
7. Support packaging to automatically generate 7z compressed packages
8. Support errorlog error interception
9. Support multi theme and multi layout switching
Precautions for use:
1. The project uses lf line feed instead of CRLF line feed by default. When creating a new file, please pay attention to selecting the file line feed
2. The project uses the strictest eslint verification specification (plugin: Vue / recommended) by default. Before using it, it is recommended to configure the development tool to realize automatic repair (vscode development is recommended)
3. The project uses the MIT open source agreement with the broadest requirements, and the MIT open source agreement can be used for free
```
## 💚 Suitable for people
- I am developing and want to use element UI / element plus, with 1 year of front-end development experience +.
- Familiar with vue.js technology stack and developed several practical projects with it.
- Students who are interested in principle and technology and want to improve.
## 🎉 Function map
![img](https://gcore.jsdelivr.net/gh/zxwk1998/image/vip/flow.drawio.png)
## 🗃️ design sketch
The following is a screenshot of the pro version:
<table>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/2.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/6.png">
</td>
</tr>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/8.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/9.png">
</td>
</tr>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/3.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/5.png">
</td>
</tr>
</table>
## 📄 Commercial considerations
This project can be used for commercial purposes free of charge. Please abide by the MIT agreement and keep the author's
technical support statement. For customized source code copyright information, please contact customer service QQ 783963206.
<!-- ## 严正声明
近期发现不少游手好闲之人有组织有预谋的利用码云、知乎、掘金等网站可用国外非法网站提供的匿名手机号注册的账号 bug 冒充 vab 去攻击 vue-element-adminiview-admin若依d2-adminant-design-vue 的行为,恶意制造对立,试图让其他开源作者卷入其中,对各位开源作者造成的影响我们深表歉意,我们欢迎 vab 的用户去体验其他更优秀的框架vue-admin-beautiful 走到今天实属不易,被人冒充,被人发帖诋毁,被人故意发布错误言论假装发帖表扬实则为我们招骂,无意动任何人的奶酪,从 2020 年至今坚持全职维护已过一年时间,说实在的我们靠技术生存并不丢人吧,一年来感谢 vab 的用户对我们不离不弃,也希望大家越来越好,加油! -->

333
README.md
View File

@ -1,84 +1,307 @@
# ELADMIN-WEB
<div>
ELADMIN 前端源码
简体中文 | [English](./README.en.md)
#### 项目源码
<div align="center">
<img width="200" src="https://assets.rspack.rs/rspack/rspack-logo.svg"/>
| | 后端源码 | 前端源码 |
|--- |--- | --- |
| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-web |
| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-web |
<h1>Vue Admin Better</h1>
<p>拒绝过度封装,去除等待时间,让项目回归纯粹,让开发变得简单</p>
<p>致力于成为开源社区中运行速度最快、打包等待时间最短、上手难度最低的中后台前端框架</p>
</div>
#### 开发文档
[https://eladmin.vip](https://eladmin.vip)
[![stars](https://img.shields.io/github/stars/zxwk1998/vue-admin-better?style=flat-square&logo=GitHub)](https://github.com/zxwk1998/vue-admin-better)
[![star](https://gitee.com/chu1204505056/vue-admin-better/badge/star.svg?theme=gray)](https://gitee.com/chu1204505056/vue-admin-better)
[![license](https://img.shields.io/github/license/zxwk1998/vue-admin-better?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
#### 体验地址
[https://eladmin.vip/demo](https://eladmin.vip/demo)
---
#### 前端模板
## 🚀 2025 全新启程
初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
- ⚡️ 项目运行速度提升 10-15 倍,打包速度提升 20-30 倍
- 🕒 整体构建时间控制在 5 秒以内,带来飞一般的开发体验
模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
## 🎉 特性
#### VPS推荐
<a href="https://bwh81.net/aff.php?aff=70876" target="_blank">
<img src="https://eladmin.vip/images/banner/side.jpeg" style="width: 435px;border-radius: 2px;">
</a>
- 💪 40+高质量单页
- 💅 RBAC 模型 + JWT 权限控制
- 🌍 10 万+ 项目实际应用
- 👏 良好的类型定义
- 🥳 开源版本支持免费商用
- 🚀 跨平台 PC、手机端、平板
- 📦️ 后端路由动态渲染
使用优惠码: `BWHCGLUKKB`,可获得 6.81% 的折扣, [查看介绍](https://bwhstock.in/)
## 🌐 演示地址
#### Build Setup
**推荐 node 版本12-16**
``` bash
# 配置镜像加速
https://www.ydyno.com/archives/1219.html
### 💡 免费版演示
- [🎉 Vue Admin Better - github 实时部署 vue2.x + element-ui 免费商用,支持 PC、平板、手机](https://zxwk1998.github.io/vue-admin-better/)
- [🎉 Vue Admin Better vue2.x + element-ui 免费商用,支持 PC、平板、手机](https://vuejs-core.cn/vue-admin-better)
- [🎉 Vue3 Admin Better vue3.x + element-plus 免费商用,支持 PC、平板、手机](https://vuejs-core.cn/vue3-admin-better)
- [⚡️ Vue Admin Arco vue3.x + vite7.x + arco2.x 免费商用,支持 PC](https://vuejs-core.cn/vue-admin-arco/)
### 💰 付费版演示
- [🚀 Vue Admin Pro vue2.x + element-ui 2.x 付费版本,支持 PC、平板、手机](https://vuejs-core.cn/admin-pro/)
- [🚀 Vue Admin Plus vue3.x + element-plus 2.x 付费版本,支持 PC、平板、手机](https://vuejs-core.cn/admin-plus/)
- [🚀 Vue Shop Vite vue3.x + vite7.x + element-plus 2.x 付费版本,支持 PC、平板、手机](https://vuejs-core.cn/shop-vite/)
<!-- ## 🔊 温馨提示
近期,我们发现少数不法互联网用户通过 IDC 云服务器、代理 ip、本地计算机等方式对我们的演示地址发起了大规模攻击包括但不限于 DDOS 攻击、SQL 注入、大文件上传、端口扫描、目录扫描等方式,我们已第一时间通过技术手段追踪到其攻击服务器部署的网站内容,并由此推断出其所入职公司或相关联的公司,望其迷途知返,切勿再做损人不利己的事情。我们不清楚其这样做的原因,也不愿意通过以牙还牙,以眼还眼的方式,将事态扩大,为保障正常用户的访问演示地址的体验,提升访问速度,目前,演示地址已采取以下防范措施:
- 1、演示地址服务器已购买 DDOS 高防包,有效防止了大多数恶意攻击。
- 2、演示地址服务器已禁止.git、.svn、.env、.php 等后缀文件访问,单个 ip 累计访问以上文件超过 20 次,将被永久封禁,并无法再次打开演示地址。
- 3、演示地址每晚 3 点进行备份恢复、重启服务器操作,预计将有 2 到 3 分钟访问超时。
- 4、演示地址已加入恶意 ip 共享计划,对于存在恶意扫描服务器端口、服务器文件的问题 ip我们将立即封禁并同步至云服务器厂商恶意 ip 名单。
以上措施真实有效,正常用户切勿因好奇前去尝试 DDOS 高防包的准确性,采取以上措施,实属迫不得已,地球这么大,容得下每一个前端框架,希望大家在各自的人生里各自发光,把余下的时间多用来陪陪家人孩子。(温馨提示:如果您发现自己的 ip 被误封,可联系微信客服申请解除)。 -->
## 🍻 前端讨论 QQ 群
- 请我们喝杯咖啡,打赏后联系 QQ 783963206 邀请您进入讨论群(由于用户数较多,如果您打赏后未通过好友请求,可以尝试多加几次),不管您请还是不请,您都可以享受到开源的代码,感谢您的支持和信任,群内提供
vue-admin-better 基础版本、开发工具自动配置教程及项目开发文档。
<table>
<tr>
<td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/zfb_kf.jpg">
</td>
<td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/qq_group/vab-2.jpg">
</td>
<td>
<img width="200px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/qq_group/vab-3.jpg">
</td>
</tr>
</table>
## 💖 物料市场
- [🎉 物料市场](https://vuejs-core.cn/store)
## 💪 找工作
- [🎉 找好工作就到【好工作就业参考网】查看就业避坑指南](https://job.vuejs-core.cn/)
## 🌐 仓库地址
- [🌐 vue-admin-better github 仓库地址](https://github.com/zxwk1998/vue-admin-better/)
- [🌐 vue3-admin-better github 仓库地址](https://github.com/zxwk1998/vue3-admin-better/)
- [🌐 vue-admin-arco github 仓库地址](https://github.com/zxwk1998/vue-admin-arco/)
- [🌐 vue-admin-better 码云仓库地址](https://gitee.com/chu1204505056/vue-admin-better/)
- [🌐 vue3-admin-better 码云仓库地址](https://gitee.com/chu1204505056/vue3-admin-better/)
- [🌐 vue-admin-arco 码云仓库地址](https://gitee.com/chu1204505056/vue-admin-arco/)
## 📦️ 桌面应用程序
- [Admin Pro](https://gitee.com/chu1204505056/microsoft-store/raw/master/AdminPlus.zip)
- [Admin Plus](https://gitee.com/chu1204505056/microsoft-store/raw/master/AdminPlus.zip)
<!-- ## 🌱 vue3.x vue3.0-antdv 分支ant-design-vue[点击切换分支](https://github.com/zxwk1998/vue-admin-better/tree/vue3.0-antdv)
```bash
# 克隆项目
git clone -b vue3.0-antdv https://github.com/zxwk1998/vue-admin-better.git
# 安装依赖
npm i --registry=http://mirrors.cloud.tencent.com/npm/
# 本地开发 启动项目
npm run serve
``` -->
## 🌱 Vue 2.x (Element UI) - 当前仓库
```
# 克隆项目
git clone -b master https://github.com/zxwk1998/vue-admin-better.git
# 安装依赖
npm install
pnpm i --registry=http://mirrors.cloud.tencent.com/npm/
# 启动服务 localhost:8013
# 本地开发 启动项目
npm run serve:rspack
```
## 🌱 Vue 3.x (Element Plus) [点击切换仓库](https://github.com/zxwk1998/vue3-admin-better)
```
# 克隆项目
git clone https://github.com/zxwk1998/vue3-admin-better.git
# 安装依赖
pnpm i --registry=http://mirrors.cloud.tencent.com/npm/
# 本地开发 启动项目
npm run dev
# 构建生产环境
npm run build:prod
```
#### 常见问题
1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
解决方案:
```
1. 单独安装npm install --unsafe-perm node-sass
2. 直接使用npm install --unsafe-perm
```
2、加速node-sass安装
https://izlzl.com/archives/1219.html
3、出现 No module named 'distutils'
## 🌱 Vue 3.x (Arco Design) [点击切换仓库](https://github.com/zxwk1998/vue-admin-arco)
```
需要安装 python安装 pip 或者 pip3
然后安装 pip install distutils / pip3 install distutils
# 克隆项目
git clone https://github.com/zxwk1998/vue-admin-arco.git
# 安装依赖
pnpm i --registry=http://mirrors.cloud.tencent.com/npm/
# 本地开发 启动项目
npm run dev
```
#### 特别鸣谢
## 🤝 友情链接
- 感谢 [JetBrains](https://www.jetbrains.com/) 提供的非商业开源软件开发授权
- [OPSLI 基于 vue-admin-better 开源版的最佳实践](https://github.com/hiparker/opsli-boot)
- [uView uni-app 生态最优秀的 UI 框架](https://github.com/YanxinNet/uView/)
- [form-generator Element 表单设计代码生成器](https://github.com/JakHuang/form-generator/)
- [wangEditor 国产最强开源富文本编辑](https://github.com/wangeditor-team/wangEditor)
- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
## 💸 赞助支持
- 感谢 [Moxun](https://github.com/moxun1639) 大佬提供的前端 Crud 通用组件
如果您觉得 vue-admin-better 对您有帮助,欢迎赞助支持开源项目发展:
- 感谢 [zhy6599](https://gitee.com/zhy6599) 大佬提供的后端运维管理相关功能
<a title="vue" href="https://opencollective.com/vuejs" target="_blank">
<img width="64px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/vue.png"/>
</a>
<a title="element-plus" href="https://opencollective.com/element-plus" target="_blank">
<img width="64px" src="https://gcore.jsdelivr.net/gh/zxwk1998/image/element-plus.png"/>
</a>
<a title="ant-design-vue" href="https://opencollective.com/ant-design-vue" target="_blank">
<img width="64px" src="https://images.opencollective.com/ant-design-vue/2ec179b/logo/256.png"/>
</a>
- 感谢 [j.yao.SUSE](https://github.com/everhopingandwaiting) 大佬提供的匿名接口与Redis限流等功能
## 🏆 框架杰出贡献者
- 感谢 [d15801543974](https://github.com/d15801543974) 大佬提供的基于注解的通用查询方式
<a href="https://github.com/fwfmiao" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/29328241?s=50"/>
</a>
<a href="https://github.com/buuing" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/36689704?s=50"/>
</a>
<a href="https://github.com/hipi" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/22478003?s=50"/>
</a>
<a href="https://github.com/hdtopku" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/14859466?s=50"/>
</a>
<a href="https://github.com/shaonialife" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/16135960?s=50"/>
</a>
<a href="https://github.com/1511578084" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/24790218?s=50"/>
</a>
<a href="https://github.com/Arooba-git" target="_blank">
<img width="50px" style="border-radius:999px" src="https://avatars.githubusercontent.com/u/56495631?s=50"/>
</a>
#### 反馈交流
## 🌟 优势亮点
- QQ交流群891137268 、947578238、659622532
### 主要优势:
1. **灵活权限控制** - 支持前端控制路由权限(intelligence)和后端控制路由权限(all)两种模式
2. **开发效率提升** - 独家支持 mock 自动生成和自动导出功能
3. **高度可配置** - 提供 50+ 项全局精细化配置选项
4. **开发友好** - 支持 SCSS 自动排序ESLint 自动修复
5. **网络请求优化** - Axios 精细化封装,支持多数据源、多成功状态码,支持多种传参方式
6. **安全增强** - 支持登录 RSA 加密
7. **构建优化** - 支持打包自动生成 7Z 压缩包
8. **错误监控** - 支持错误日志拦截(errorlog)
9. **多样化支持** - 支持多主题、多布局切换
### 使用须知:
1. 项目默认使用 LF 换行符,请注意文件换行符设置
2. 使用最严格的 ESLint 校验规范plugin:vue/recommended建议配置开发工具自动修复推荐使用 VSCode
3. 项目采用 MIT 开源协议,保留协议声明即可免费商用
## 💚 适合人群
- 正在以及想使用 element-ui/element-plus 开发,前端开发经验 1 年+。
- 熟悉 Vue.js 技术栈,使用它开发过几个实际项目。
- 对原理技术感兴趣,想进阶和提升的同学。
## 🎨 Star
[![Stargazers for vue-admin-better](https://reporoster.com/stars/zxwk1998/vue-admin-better)](https://github.com/zxwk1998/vue-admin-better/stargazers)
## ✨ Fork
[![Forkers repo roster for vue-admin-better](https://reporoster.com/forks/zxwk1998/vue-admin-better)](https://github.com/zxwk1998/vue-admin-better/network/members)
## 🎉 功能地图
![img](https://gcore.jsdelivr.net/gh/zxwk1998/image/vip/flow.drawio.png)
## 🗃️ 效果图
以下是截取的是 pro 版的效果图展示:
<table>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/2.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/6.png">
</td>
</tr>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/8.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/9.png">
</td>
</tr>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/3.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/5.png">
</td>
</tr>
</table>
以下是截取的是 shop 版的效果图展示:
<table>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/16.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/17.png">
</td>
</tr>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/18.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/19.png">
</td>
</tr>
<tr>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/20.png">
</td>
<td>
<img src="https://gcore.jsdelivr.net/gh/zxwk1998/image/21.png">
</td>
</tr>
</table>
## 📄 商用注意事项
开源版本可免费用于商业用途,如果方便就留个 Star 吧
<!-- ,请遵守 MIT 协议并保留作者技术支持声明,当然如果不愿意保留可以删掉,毕竟我也拿您没办法,能帮到您也当是给自己积德了,至于[Admin](https://vuejs-core.cn/admin-plus/)[Shop](https://vuejs-core.cn/shop-vite/) 的付费版本的相关说明如下:
本人只参与了前期小部分的开发,所以不必跟开源版做对比,同事的代码功底比我好太多,我自愧不如,关于买这件事,没有强买强卖,您愿意买就买,不愿意买就忽略。我们不高尚,写代码就是为了养家糊口,不是为了用爱发电。这几年看到那么多开源项目借鉴了我们付费版本的布局、主题配置的灵感和创意,一开始我是鄙视的,现在还好状态调整过来了,能够被借鉴,被讨论恰好说明了我们的产品有价值,为了产品卖的更好我们也必须更加用心的去维护付费版本以保持我们产品的竞争力。
当然,最后还有几句话不得不说,身处互联网由盛转衰的大变革的洪流中,能活下来就已经是千难万难了,希望所有的程序员哥哥姐姐们,早日实现自己的梦想,完成自己的心愿,也想对刚要毕业准备做一名程序员的学弟学妹们说几句,互联网行业没有你们想象的那么高大上,如果想成为一名程序员那就做好加班的准备,如果有更好的选择那就别选这个行业了。 -->
</div>

View File

@ -1,11 +1,7 @@
const plugins = ['@vue/babel-plugin-transform-vue-jsx']
// 生产环境移除console
if (process.env.NODE_ENV === 'production') {
plugins.push('transform-remove-console')
}
/**
* @author https://github.com/zxwk1998/vue-admin-better 不想保留author可删除
* @description babel.config
*/
module.exports = {
plugins: plugins,
presets: [
'@vue/app'
]
presets: ['@vue/cli-plugin-babel/preset'],
}

20
deploy.sh Normal file
View File

@ -0,0 +1,20 @@
#强制推送
#!/usr/bin/env bash
set -e
npm run build
cd dist
touch .nojekyll
git init
git add -A
git commit -m 'deploy'
git push -f "https://${access_token}@gitee.com/chu1204505056/vue-admin-better.git" master:gh-pages
git push -f "https://${access_token}@gitee.com/chu1204505056/vue-admin-better-element.git" master:gh-pages
start "https://gitee.com/chu1204505056/vue-admin-better/pages"
start "https://gitee.com/chu1204505056/vue-admin-better-element/pages"
git push -f "https://${access_token}@github.com/zxwk1998/vue-admin-better.git" master:gh-pages
cd -
exec /bin/bash

View File

@ -1,24 +0,0 @@
module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/tests/unit/coverage',
// 'collectCoverage': true,
'coverageReporters': [
'lcov',
'text-summary'
],
testURL: 'http://localhost/'
}

View File

@ -0,0 +1,13 @@
import permissions from './permissions'
const install = function (Vue) {
Vue.directive('permissions', permissions)
}
if (window.Vue) {
window['permissions'] = permissions
Vue.use(install)
}
permissions.install = install
export default permissions

View File

@ -0,0 +1,13 @@
import store from '@/store'
export default {
inserted(element, binding) {
const { value } = binding
const permissions = store.getters['user/permissions']
if (value && value instanceof Array && value.length > 0) {
const hasPermission = permissions.some((role) => value.includes(role))
if (!hasPermission)
element.parentNode && element.parentNode.removeChild(element)
}
},
}

57
layouts/index.js Normal file
View File

@ -0,0 +1,57 @@
/**
* @description Vue Admin Better 项目配置
*/
const webpackBarName = 'vue-admin-better'
const webpackBanner = (time) =>
`vue-admin-better
GitHub: https://github.com/zxwk1998/vue-admin-better
Gitee: https://gitee.com/chu1204505056/vue-admin-better
版权所有 (c) 2025 vue-admin-better
本项目使用 MIT 许可证
构建时间: ${time}`
/**
* @description 在控制台打印项目信息
*/
function donationConsole() {
const chalk = require('chalk')
console.log(
chalk.green(
`> 欢迎使用vue-admin-bettergithub开源地址https://github.com/zxwk1998/vue-admin-better`
)
)
console.log(
chalk.green(
`> 欢迎使用vue-admin-better码云开源地址https://gitee.com/chu1204505056/vue-admin-better`
)
)
console.log(chalk.green(`> pro版演示地址http://vuejs-core.cn/admin-pro`))
console.log(chalk.green(`> plus版演示地址http://vuejs-core.cn/admin-plus`))
console.log(chalk.green(`> shop版演示地址http://vuejs-core.cn/shop-vite`))
console.log(
chalk.green(
`> 找好工作就到【好工作就业参考网】查看就业避坑指南https://job.vuejs-core.cn/`
)
)
console.log(
chalk.green(
`> 使用中出现任何问题可加QQ群反馈获取基础版、文档请我们喝杯咖啡如若情况不允许请勿勉强https://gitee.com/chu1204505056/vue-admin-better#-%E5%89%8D%E7%AB%AF%E8%AE%A8%E8%AE%BA-qq-%E7%BE%A4`
)
)
console.log(chalk.green(`> 如果您不希望显示以上信息可在config中配置关闭`))
console.log('\n')
}
module.exports = {
webpackBarName,
webpackBanner,
donationConsole,
}

5
layouts/package.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "layouts",
"version": "1.0.0",
"main": "index.js"
}

View File

@ -0,0 +1,16 @@
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'always',
htmlWhitespaceSensitivity: 'ignore',
vueIndentScriptAndStyle: true,
endOfLine: 'lf',
}

View File

@ -0,0 +1,321 @@
const data = [
'alphabetical_sorting',
'alphabetical_sorting',
'alarm_clock',
'area_chart',
'approval',
'answers',
'approve',
'assistant',
'automotive',
'automatic',
'bad_decision',
'bar_chart',
'bearish',
'biomass',
'biohazard',
'binoculars',
'bookmark',
'briefcase',
'biotech',
'broken_link',
'business',
'bullish',
'business_contact',
'businesswoman',
'cable_release',
'calculator',
'businessman',
'calendar',
'butting_in',
'call_transfer',
'callback',
'camcorder',
'camera',
'camcorder_pro',
'cancel',
'camera_addon',
'camera_identificatio',
'capacitor',
'candle_sticks',
'checkmark',
'circuit',
'charge_battery',
'clear_filters',
'clapperboard',
'clock',
'close_up_mode',
'collaboration',
'cell_phone',
'collapse',
'collect',
'cloth',
'combo_chart',
'comments',
'conference_call',
'compact_camera',
'contacts',
'copyleft',
'copyright',
'crystal_oscillator',
'cursor',
'currency_exchange',
'customer_support',
'dam',
'data_backup',
'data_configuration',
'data_encryption',
'data_protection',
'data_recovery',
'database',
'data_sheet',
'debt',
'decision',
'delete_column',
'delete_database',
'department',
'delete_row',
'deployment',
'dislike',
'disapprove',
'disclaimer',
'display',
'document',
'do_not_insert',
'do_not_mix',
'do_not_inhale',
'donate',
'down',
'doughnut_chart',
'down_left',
'down_right',
'download',
'edit_image',
'electrical_sensor',
'electrical_threshold',
'electricity',
'electro_devices',
'electronics',
'empty_battery',
'empty_filter',
'empty_trash',
'end_call',
'engineering',
'entering_heaven_aliv',
'expand',
'export',
'expired',
'factory',
'factory_breakdown',
'external',
'faq',
'feed_in',
'file',
'feedback',
'film',
'filled_filter',
'filing_cabinet',
'film_reel',
'flash_auto',
'fine_print',
'flash_off',
'flash_on',
'flow_chart',
'folder',
'frame',
'full_battery',
'full_trash',
'gallery',
'generic_sorting_asc',
'generic_sorting_desc',
'genealogy',
'globe',
'good_decision',
'headset',
'grid',
'graduation_cap',
'heat_map',
'high_priority',
'high_battery',
'image_file',
'home',
'idea',
'import',
'in_transit',
'integrated_webcam',
'inspection',
'invite',
'internal',
'ipad',
'info',
'iphone',
'kindle',
'key',
'landscape',
'left',
'left_down',
'left_up',
'leave',
'like_placeholder',
'light_at_the_end_of_',
'library',
'line_chart',
'link',
'like',
'lock',
'list',
'lock_landscape',
'low_battery',
'lock_portrait',
'low_priority',
'make_decision',
'medium_priority',
'manager',
'menu',
'middle_battery',
'minus',
'missed_call',
'mind_map',
'mms',
'multiple_cameras',
'money_transfer',
'music',
'multiple_devices',
'multiple_smartphones',
'multiple_inputs',
'negative_dynamic',
'neutral_decision',
'night_landscape',
'news',
'neutral_trading',
'night_portrait',
'no_idea',
'next',
'no_video',
'nook',
'ok',
'org_unit',
'opened_folder',
'old_time_camera',
'online_support',
'organization',
'package',
'paid',
'parallel_tasks',
'overtime',
'panorama',
'phone',
'phone_android',
'photo_reel',
'pie_chart',
'picture',
'planner',
'plus',
'podium_with_audience',
'podium_without_speak',
'podium_with_speaker',
'previous',
'portrait_mode',
'positive_dynamic',
'privacy',
'process',
'puzzle',
'questions',
'print',
'radar_plot',
'rating',
'ratings',
'reading',
'redo',
'reading_ebook',
'refresh',
'registered_trademark',
'right',
'reuse',
'remove_image',
'right_down',
'right_up',
'rotate_to_portrait',
'rules',
'rotate_camera',
'rotate_to_landscape',
'ruler',
'scatter_plot',
'search',
'safe',
'self_service_kiosk',
'selfie',
'serial_tasks',
'sales_performance',
'settings',
'services',
'share',
'shipped',
'sim_card',
'shop',
'service_mark',
'sim_card_chip',
'signature',
'smartphone_tablet',
'sound_recording_copy',
'sms',
'speaker',
'slr_back_side',
'start',
'stack_of_photos',
'statistics',
'sports_mode',
'support',
'synchronize',
'switch_camera',
'survey',
'tablet_android',
'template',
'trademark',
'todo_list',
'touchscreen_smartpho',
'timeline',
'tree_structure',
'undo',
'up_left',
'two_smartphones',
'unlock',
'up',
'up_right',
'upload',
'video_call',
'video_file',
'view_details',
'video_projector',
'vip',
'voice_presentation',
'webcam',
'voicemail',
'workflow',
'about',
'accept_database',
'add_image',
'add_column',
'add_database',
'add_row',
]
module.exports = [
{
url: '/colorfulIcon/getList',
type: 'post',
response(config) {
const { title, pageNo = 1, pageSize = 72 } = config.body
let mockList = data.filter((item) => {
if (title && item.indexOf(title) < 0) return false
return true
})
const pageList = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
totalCount: mockList.length,
data: pageList,
}
},
},
]

View File

@ -0,0 +1,40 @@
const { mock } = require('mockjs')
const List = []
const count = 999
let num = 0
for (let i = 0; i < count; i++) {
List.push(
mock({
uuid: '@uuid',
image: `https://picsum.photos/300/600?random=${num++}`,
title: '@ctitle',
description: '@csentence',
link: 'https://www.baidu.com',
price: '@integer(100, 500)',
'status|1': [1, 0],
'isRecommend|1': [1, 0],
})
)
}
module.exports = [
{
url: '/goodsList/getList',
type: 'post',
response(config) {
const { title = '', pageNo = 1, pageSize = 20 } = config.body
let mockList = List.filter((item) => {
if (title && item.title.indexOf(title) < 0) return false
return true
})
const pageList = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
totalCount: count,
data: pageList,
}
},
},
]

982
mock/controller/icon.js Normal file
View File

@ -0,0 +1,982 @@
const data = [
'air-freshener',
'align-center',
'align-justify',
'align-left',
'align-right',
'allergies',
'ambulance',
'american-sign-language-interpreting',
'anchor',
'angle-double-down',
'angle-double-left',
'angle-double-right',
'angle-double-up',
'angle-down',
'angle-left',
'angle-right',
'angle-up',
'angry',
'ankh',
'apple-alt',
'archive',
'archway',
'arrow-alt-circle-down',
'arrow-alt-circle-left',
'arrow-alt-circle-right',
'arrow-alt-circle-up',
'arrow-circle-down',
'arrow-circle-left',
'arrow-circle-right',
'arrow-circle-up',
'arrow-down',
'arrow-left',
'arrow-right',
'arrow-up',
'arrows-alt',
'arrows-alt-h',
'arrows-alt-v',
'assistive-listening-systems',
'asterisk',
'at',
'atlas',
'atom',
'audio-description',
'award',
'baby',
'baby-carriage',
'backspace',
'backward',
'bacon',
'bahai',
'balance-scale',
'balance-scale-left',
'balance-scale-right',
'ban',
'band-aid',
'barcode',
'bars',
'baseball-ball',
'basketball-ball',
'bath',
'battery-empty',
'battery-full',
'battery-half',
'battery-quarter',
'battery-three-quarters',
'bed',
'beer',
'bell',
'bell-slash',
'bezier-curve',
'bible',
'bicycle',
'biking',
'binoculars',
'biohazard',
'birthday-cake',
'blender',
'blender-phone',
'blind',
'blog',
'bold',
'bolt',
'bomb',
'bone',
'bong',
'book',
'book-dead',
'book-medical',
'book-open',
'book-reader',
'bookmark',
'border-all',
'border-none',
'border-style',
'bowling-ball',
'box',
'box-open',
'boxes',
'braille',
'brain',
'bread-slice',
'briefcase',
'briefcase-medical',
'broadcast-tower',
'broom',
'brush',
'bug',
'building',
'bullhorn',
'bullseye',
'burn',
'bus',
'bus-alt',
'business-time',
'calculator',
'calendar',
'calendar-alt',
'calendar-check',
'calendar-day',
'calendar-minus',
'calendar-plus',
'calendar-times',
'calendar-week',
'camera',
'camera-retro',
'campground',
'candy-cane',
'cannabis',
'capsules',
'car',
'car-alt',
'car-battery',
'car-crash',
'car-side',
'caravan',
'caret-down',
'caret-left',
'caret-right',
'caret-square-down',
'caret-square-left',
'caret-square-right',
'caret-square-up',
'caret-up',
'carrot',
'cart-arrow-down',
'cart-plus',
'cash-register',
'cat',
'certificate',
'chair',
'chalkboard',
'chalkboard-teacher',
'charging-station',
'chart-area',
'chart-bar',
'chart-line',
'chart-pie',
'check',
'check-circle',
'check-double',
'check-square',
'cheese',
'chess',
'chess-bishop',
'chess-board',
'chess-king',
'chess-knight',
'chess-pawn',
'chess-queen',
'chess-rook',
'chevron-circle-down',
'chevron-circle-left',
'chevron-circle-right',
'chevron-circle-up',
'chevron-down',
'chevron-left',
'chevron-right',
'chevron-up',
'child',
'church',
'circle',
'circle-notch',
'city',
'clinic-medical',
'clipboard',
'clipboard-check',
'clipboard-list',
'clock',
'clone',
'closed-captioning',
'cloud',
'cloud-download-alt',
'cloud-meatball',
'cloud-moon',
'cloud-moon-rain',
'cloud-rain',
'cloud-showers-heavy',
'cloud-sun',
'cloud-sun-rain',
'cloud-upload-alt',
'cocktail',
'code',
'code-branch',
'coffee',
'cog',
'cogs',
'coins',
'columns',
'comment',
'comment-alt',
'comment-dollar',
'comment-dots',
'comment-medical',
'comment-slash',
'comments',
'comments-dollar',
'compact-disc',
'compass',
'compress',
'compress-alt',
'compress-arrows-alt',
'concierge-bell',
'cookie',
'cookie-bite',
'copy',
'copyright',
'couch',
'credit-card',
'crop',
'crop-alt',
'cross',
'crosshairs',
'crow',
'crown',
'crutch',
'cube',
'cubes',
'cut',
'database',
'deaf',
'democrat',
'desktop',
'dharmachakra',
'diagnoses',
'dice',
'dice-d20',
'dice-d6',
'dice-five',
'dice-four',
'dice-one',
'dice-six',
'dice-three',
'dice-two',
'digital-tachograph',
'directions',
'divide',
'dizzy',
'dna',
'dog',
'dollar-sign',
'dolly',
'dolly-flatbed',
'donate',
'door-closed',
'door-open',
'dot-circle',
'dove',
'download',
'drafting-compass',
'dragon',
'draw-polygon',
'drum',
'drum-steelpan',
'drumstick-bite',
'dumbbell',
'dumpster',
'dumpster-fire',
'dungeon',
'edit',
'egg',
'eject',
'ellipsis-h',
'ellipsis-v',
'envelope',
'envelope-open',
'envelope-open-text',
'envelope-square',
'equals',
'eraser',
'ethernet',
'euro-sign',
'exchange-alt',
'exclamation',
'exclamation-circle',
'exclamation-triangle',
'expand',
'expand-alt',
'expand-arrows-alt',
'external-link-alt',
'external-link-square-alt',
'eye',
'eye-dropper',
'eye-slash',
'fan',
'fast-backward',
'fast-forward',
'fax',
'feather',
'feather-alt',
'female',
'fighter-jet',
'file',
'file-alt',
'file-archive',
'file-audio',
'file-code',
'file-contract',
'file-csv',
'file-download',
'file-excel',
'file-export',
'file-image',
'file-import',
'file-invoice',
'file-invoice-dollar',
'file-medical',
'file-medical-alt',
'file-pdf',
'file-powerpoint',
'file-prescription',
'file-signature',
'file-upload',
'file-video',
'file-word',
'fill',
'fill-drip',
'film',
'filter',
'fingerprint',
'fire',
'fire-alt',
'fire-extinguisher',
'first-aid',
'fish',
'fist-raised',
'flag',
'flag-checkered',
'flag-usa',
'flask',
'flushed',
'folder',
'folder-minus',
'folder-open',
'folder-plus',
'font',
'football-ball',
'forward',
'frog',
'frown',
'frown-open',
'funnel-dollar',
'futbol',
'gamepad',
'gas-pump',
'gavel',
'gem',
'genderless',
'ghost',
'gift',
'gifts',
'glass-cheers',
'glass-martini',
'glass-martini-alt',
'glass-whiskey',
'glasses',
'globe',
'globe-africa',
'globe-americas',
'globe-asia',
'globe-europe',
'golf-ball',
'gopuram',
'graduation-cap',
'greater-than',
'greater-than-equal',
'grimace',
'grin',
'grin-alt',
'grin-beam',
'grin-beam-sweat',
'grin-hearts',
'grin-squint',
'grin-squint-tears',
'grin-stars',
'grin-tears',
'grin-tongue',
'grin-tongue-squint',
'grin-tongue-wink',
'grin-wink',
'grip-horizontal',
'grip-lines',
'grip-lines-vertical',
'grip-vertical',
'guitar',
'h-square',
'hamburger',
'hammer',
'hamsa',
'hand-holding',
'hand-holding-heart',
'hand-holding-usd',
'hand-lizard',
'hand-middle-finger',
'hand-paper',
'hand-peace',
'hand-point-down',
'hand-point-left',
'hand-point-right',
'hand-point-up',
'hand-pointer',
'hand-rock',
'hand-scissors',
'hand-spock',
'hands',
'hands-helping',
'handshake',
'hanukiah',
'hard-hat',
'hashtag',
'hat-cowboy',
'hat-cowboy-side',
'hat-wizard',
'hdd',
'heading',
'headphones',
'headphones-alt',
'headset',
'heart',
'heart-broken',
'heartbeat',
'helicopter',
'highlighter',
'hiking',
'hippo',
'history',
'hockey-puck',
'holly-berry',
'home',
'horse',
'horse-head',
'hospital',
'hospital-alt',
'hospital-symbol',
'hot-tub',
'hotdog',
'hotel',
'hourglass',
'hourglass-end',
'hourglass-half',
'hourglass-start',
'house-damage',
'hryvnia',
'i-cursor',
'ice-cream',
'icicles',
'icons',
'id-badge',
'id-card',
'id-card-alt',
'igloo',
'image',
'images',
'inbox',
'indent',
'industry',
'infinity',
'info',
'info-circle',
'italic',
'jedi',
'joint',
'journal-whills',
'kaaba',
'key',
'keyboard',
'khanda',
'kiss',
'kiss-beam',
'kiss-wink-heart',
'kiwi-bird',
'landmark',
'language',
'laptop',
'laptop-code',
'laptop-medical',
'laugh',
'laugh-beam',
'laugh-squint',
'laugh-wink',
'layer-group',
'leaf',
'lemon',
'less-than',
'less-than-equal',
'level-down-alt',
'level-up-alt',
'life-ring',
'lightbulb',
'link',
'lira-sign',
'list',
'list-alt',
'list-ol',
'list-ul',
'location-arrow',
'lock',
'lock-open',
'long-arrow-alt-down',
'long-arrow-alt-left',
'long-arrow-alt-right',
'long-arrow-alt-up',
'low-vision',
'luggage-cart',
'magic',
'magnet',
'mail-bulk',
'male',
'map',
'map-marked',
'map-marked-alt',
'map-marker',
'map-marker-alt',
'map-pin',
'map-signs',
'marker',
'mars',
'mars-double',
'mars-stroke',
'mars-stroke-h',
'mars-stroke-v',
'mask',
'medal',
'medkit',
'meh',
'meh-blank',
'meh-rolling-eyes',
'memory',
'menorah',
'mercury',
'meteor',
'microchip',
'microphone',
'microphone-alt',
'microphone-alt-slash',
'microphone-slash',
'microscope',
'minus',
'minus-circle',
'minus-square',
'mitten',
'mobile',
'mobile-alt',
'money-bill',
'money-bill-alt',
'money-bill-wave',
'money-bill-wave-alt',
'money-check',
'money-check-alt',
'monument',
'moon',
'mortar-pestle',
'mosque',
'motorcycle',
'mountain',
'mouse',
'mouse-pointer',
'mug-hot',
'music',
'network-wired',
'neuter',
'newspaper',
'not-equal',
'notes-medical',
'object-group',
'object-ungroup',
'oil-can',
'om',
'otter',
'outdent',
'pager',
'paint-brush',
'paint-roller',
'palette',
'pallet',
'paper-plane',
'paperclip',
'parachute-box',
'paragraph',
'parking',
'passport',
'pastafarianism',
'paste',
'pause',
'pause-circle',
'paw',
'peace',
'pen',
'pen-alt',
'pen-fancy',
'pen-nib',
'pen-square',
'pencil-alt',
'pencil-ruler',
'people-carry',
'pepper-hot',
'percent',
'percentage',
'person-booth',
'phone',
'phone-alt',
'phone-slash',
'phone-square',
'phone-square-alt',
'phone-volume',
'photo-video',
'piggy-bank',
'pills',
'pizza-slice',
'place-of-worship',
'plane',
'plane-arrival',
'plane-departure',
'play',
'play-circle',
'plug',
'plus',
'plus-circle',
'plus-square',
'podcast',
'poll',
'poll-h',
'poo',
'poo-storm',
'poop',
'portrait',
'pound-sign',
'power-off',
'pray',
'praying-hands',
'prescription',
'prescription-bottle',
'prescription-bottle-alt',
'print',
'procedures',
'project-diagram',
'puzzle-piece',
'qrcode',
'question',
'question-circle',
'quidditch',
'quote-left',
'quote-right',
'quran',
'radiation',
'radiation-alt',
'rainbow',
'random',
'receipt',
'record-vinyl',
'recycle',
'redo',
'redo-alt',
'registered',
'remove-format',
'reply',
'reply-all',
'republican',
'restroom',
'retweet',
'ribbon',
'ring',
'road',
'robot',
'rocket',
'route',
'rss',
'rss-square',
'ruble-sign',
'ruler',
'ruler-combined',
'ruler-horizontal',
'ruler-vertical',
'running',
'rupee-sign',
'sad-cry',
'sad-tear',
'satellite',
'satellite-dish',
'save',
'school',
'screwdriver',
'scroll',
'sd-card',
'search',
'search-dollar',
'search-location',
'search-minus',
'search-plus',
'seedling',
'server',
'shapes',
'share',
'share-alt',
'share-alt-square',
'share-square',
'shekel-sign',
'shield-alt',
'ship',
'shipping-fast',
'shoe-prints',
'shopping-bag',
'shopping-basket',
'shopping-cart',
'shower',
'shuttle-van',
'sign',
'sign-in-alt',
'sign-language',
'sign-out-alt',
'signal',
'signature',
'sim-card',
'sitemap',
'skating',
'skiing',
'skiing-nordic',
'skull',
'skull-crossbones',
'slash',
'sleigh',
'sliders-h',
'smile',
'smile-beam',
'smile-wink',
'smog',
'smoking',
'smoking-ban',
'sms',
'snowboarding',
'snowflake',
'snowman',
'snowplow',
'socks',
'solar-panel',
'sort',
'sort-alpha-down',
'sort-alpha-down-alt',
'sort-alpha-up',
'sort-alpha-up-alt',
'sort-amount-down',
'sort-amount-down-alt',
'sort-amount-up',
'sort-amount-up-alt',
'sort-down',
'sort-numeric-down',
'sort-numeric-down-alt',
'sort-numeric-up',
'sort-numeric-up-alt',
'sort-up',
'spa',
'space-shuttle',
'spell-check',
'spider',
'spinner',
'splotch',
'spray-can',
'square',
'square-full',
'square-root-alt',
'stamp',
'star',
'star-and-crescent',
'star-half',
'star-half-alt',
'star-of-david',
'star-of-life',
'step-backward',
'step-forward',
'stethoscope',
'sticky-note',
'stop',
'stop-circle',
'stopwatch',
'store',
'store-alt',
'stream',
'street-view',
'strikethrough',
'stroopwafel',
'subscript',
'subway',
'suitcase',
'suitcase-rolling',
'sun',
'superscript',
'surprise',
'swatchbook',
'swimmer',
'swimming-pool',
'synagogue',
'sync',
'sync-alt',
'syringe',
'table',
'table-tennis',
'tablet',
'tablet-alt',
'tablets',
'tachometer-alt',
'tag',
'tags',
'tape',
'tasks',
'taxi',
'teeth',
'teeth-open',
'temperature-high',
'temperature-low',
'tenge',
'terminal',
'text-height',
'text-width',
'th',
'th-large',
'th-list',
'theater-masks',
'thermometer',
'thermometer-empty',
'thermometer-full',
'thermometer-half',
'thermometer-quarter',
'thermometer-three-quarters',
'thumbs-down',
'thumbs-up',
'thumbtack',
'ticket-alt',
'times',
'times-circle',
'tint',
'tint-slash',
'tired',
'toggle-off',
'toggle-on',
'toilet',
'toilet-paper',
'toolbox',
'tools',
'tooth',
'torah',
'torii-gate',
'tractor',
'trademark',
'traffic-light',
'trailer',
'train',
'tram',
'transgender',
'transgender-alt',
'trash',
'trash-alt',
'trash-restore',
'trash-restore-alt',
'tree',
'trophy',
'truck',
'truck-loading',
'truck-monster',
'truck-moving',
'truck-pickup',
'tshirt',
'tty',
'tv',
'umbrella',
'umbrella-beach',
'underline',
'undo',
'undo-alt',
'universal-access',
'university',
'unlink',
'unlock',
'unlock-alt',
'upload',
'user',
'user-alt',
'user-alt-slash',
'user-astronaut',
'user-check',
'user-circle',
'user-clock',
'user-cog',
'user-edit',
'user-friends',
'user-graduate',
'user-injured',
'user-lock',
'user-md',
'user-minus',
'user-ninja',
'user-nurse',
'user-plus',
'user-secret',
'user-shield',
'user-slash',
'user-tag',
'user-tie',
'user-times',
'users',
'users-cog',
'utensil-spoon',
'utensils',
'vector-square',
'venus',
'venus-double',
'venus-mars',
'vial',
'vials',
'video',
'video-slash',
'vihara',
'voicemail',
'volleyball-ball',
'volume-down',
'volume-mute',
'volume-off',
'volume-up',
'vote-yea',
'vr-cardboard',
'walking',
'wallet',
'warehouse',
'water',
'wave-square',
'weight',
'weight-hanging',
'wheelchair',
'wifi',
'wind',
'window-close',
'window-maximize',
'window-minimize',
'window-restore',
'wine-bottle',
'wine-glass',
'wine-glass-alt',
'won-sign',
'wrench',
'x-ray',
'yen-sign',
'yin-yang',
]
module.exports = [
{
url: '/icon/getList',
type: 'post',
response(config) {
const { title, pageNo = 1, pageSize = 72 } = config.body
let mockList = data.filter((item) => {
if (title && item.indexOf(title) < 0) return false
return true
})
const pageList = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
totalCount: mockList.length,
data: pageList,
}
},
},
]

View File

@ -0,0 +1,51 @@
module.exports = [
{
url: '/menuManagement/getTree',
type: 'post',
response() {
return {
code: 200,
msg: 'success',
totalCount: 999,
data: [
{
id: 'root',
label: '全部角色',
children: [
{
id: '@id',
permission: 'admin',
label: 'admin角色',
},
{
id: '@id',
permission: 'editor',
label: 'editor角色',
},
],
},
],
}
},
},
{
url: '/menuManagement/doEdit',
type: 'post',
response() {
return {
code: 200,
msg: '模拟保存成功',
}
},
},
{
url: '/menuManagement/doDelete',
type: 'post',
response() {
return {
code: 200,
msg: '模拟删除成功',
}
},
},
]

View File

@ -0,0 +1,42 @@
const { mock } = require('mockjs')
module.exports = [
{
url: '/personalCenter/getList',
type: 'post',
response(config) {
return {
code: 200,
msg: 'success',
totalCount: 999,
data: mock({
'data|10': [
{
id: '@id',
},
],
}).data,
}
},
},
{
url: '/personalCenter/doEdit',
type: 'post',
response() {
return {
code: 200,
msg: '模拟保存成功',
}
},
},
{
url: '/personalCenter/doDelete',
type: 'post',
response() {
return {
code: 200,
msg: '模拟删除成功',
}
},
},
]

View File

@ -0,0 +1,50 @@
const totalCount = 2
const List = [
{
id: '@id',
permission: 'admin',
},
{
id: '@id',
permission: 'editor',
},
]
module.exports = [
{
url: '/roleManagement/getList',
type: 'post',
response(config) {
const { title = '', pageNo = 1, pageSize = 20 } = config.body
let mockList = List.filter((item) => {
return !(title && item.title.indexOf(title) < 0)
})
const pageList = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
totalCount,
data: pageList,
}
},
},
{
url: '/roleManagement/doEdit',
type: 'post',
response() {
return {
code: 200,
msg: '模拟保存成功',
}
},
},
{
url: '/roleManagement/doDelete',
type: 'post',
response() {
return {
code: 200,
msg: '模拟删除成功',
}
},
},
]

256
mock/controller/router.js Normal file
View File

@ -0,0 +1,256 @@
const data = [
{
path: '/',
component: 'Layout',
redirect: 'index',
children: [
{
path: 'index',
name: 'Index',
component: '@/views/index/index',
meta: {
title: '首页',
icon: 'home',
affix: true,
},
},
],
},
{
path: '/personnelManagement',
component: 'Layout',
redirect: 'noRedirect',
name: 'PersonnelManagement',
meta: { title: '人员', icon: 'users-cog', permissions: ['admin'] },
children: [
{
path: 'userManagement',
name: 'UserManagement',
component: '@/views/personnelManagement/userManagement/index',
meta: { title: '用户管理' },
},
{
path: 'roleManagement',
name: 'RoleManagement',
component: '@/views/personnelManagement/roleManagement/index',
meta: { title: '角色管理' },
},
{
path: 'menuManagement',
name: 'MenuManagement',
component: '@/views/personnelManagement/menuManagement/index',
meta: { title: '菜单管理', badge: 'New' },
},
],
},
{
path: '/vab',
component: 'Layout',
redirect: 'noRedirect',
name: 'Vab',
alwaysShow: true,
meta: { title: '组件', icon: 'cloud' },
children: [
{
path: 'permissions',
name: 'Permission',
component: '@/views/vab/permissions/index',
meta: {
title: '权限控制',
permissions: ['admin', 'editor'],
badge: 'New',
},
},
{
path: 'icon',
component: 'EmptyLayout',
redirect: 'noRedirect',
name: 'Icon',
meta: {
title: '图标',
permissions: ['admin'],
},
children: [
{
path: 'awesomeIcon',
name: 'AwesomeIcon',
component: '@/views/vab/icon/index',
meta: { title: '常规图标' },
},
{
path: 'colorfulIcon',
name: 'ColorfulIcon',
component: '@/views/vab/icon/colorfulIcon',
meta: { title: '多彩图标' },
},
],
},
{
path: 'table',
component: '@/views/vab/table/index',
name: 'Table',
meta: {
title: '表格',
permissions: ['admin'],
},
},
{
path: 'webSocket',
name: 'WebSocket',
component: '@/views/vab/webSocket/index',
meta: { title: 'webSocket', permissions: ['admin'] },
},
{
path: 'form',
name: 'Form',
component: '@/views/vab/form/index',
meta: { title: '表单', permissions: ['admin'] },
},
{
path: 'element',
name: 'Element',
component: '@/views/vab/element/index',
meta: { title: '常用组件', permissions: ['admin'] },
},
{
path: 'tree',
name: 'Tree',
component: '@/views/vab/tree/index',
meta: { title: '树', permissions: ['admin'] },
},
{
path: 'verify',
name: 'Verify',
component: '@/views/vab/verify/index',
meta: { title: '验证码', permissions: ['admin'] },
},
{
path: 'menu1',
component: '@/views/vab/nested/menu1/index',
name: 'Menu1',
alwaysShow: true,
meta: {
title: '嵌套路由 1',
permissions: ['admin'],
},
children: [
{
path: 'menu1-1',
name: 'Menu1-1',
alwaysShow: true,
meta: { title: '嵌套路由 1-1' },
component: '@/views/vab/nested/menu1/menu1-1/index',
children: [
{
path: 'menu1-1-1',
name: 'Menu1-1-1',
meta: { title: '嵌套路由 1-1-1' },
component: '@/views/vab/nested/menu1/menu1-1/menu1-1-1/index',
},
],
},
],
},
{
path: 'loading',
name: 'Loading',
component: '@/views/vab/loading/index',
meta: { title: 'loading', permissions: ['admin'] },
},
{
path: 'backToTop',
name: 'BackToTop',
component: '@/views/vab/backToTop/index',
meta: { title: '返回顶部', permissions: ['admin'] },
},
{
path: 'lodash',
name: 'Lodash',
component: '@/views/vab/lodash/index',
meta: { title: 'lodash', permissions: ['admin'] },
},
{
path: 'upload',
name: 'Upload',
component: '@/views/vab/upload/index',
meta: { title: '上传', permissions: ['admin'] },
},
{
path: 'log',
name: 'Log',
component: '@/views/vab/errorLog/index',
meta: { title: '错误日志模拟', permissions: ['admin'] },
},
{
path: 'more',
name: 'More',
component: '@/views/vab/more/index',
meta: { title: '关于', permissions: ['admin'] },
},
],
},
{
path: '/mall',
component: 'Layout',
redirect: 'noRedirect',
name: 'Mall',
meta: {
title: '商城',
icon: 'shopping-cart',
permissions: ['admin'],
},
children: [
{
path: 'pay',
name: 'Pay',
component: '@/views/mall/pay/index',
meta: {
title: '支付',
noKeepAlive: true,
},
children: null,
},
{
path: 'goodsList',
name: 'GoodsList',
component: '@/views/mall/goodsList/index',
meta: {
title: '商品列表',
},
},
],
},
{
path: '/error',
component: 'EmptyLayout',
redirect: 'noRedirect',
name: 'Error',
meta: { title: '错误页', icon: 'bug' },
children: [
{
path: '401',
name: 'Error401',
component: '@/views/401',
meta: { title: '401' },
},
{
path: '404',
name: 'Error404',
component: '@/views/404',
meta: { title: '404' },
},
],
},
]
module.exports = [
{
url: '/menu/navigate',
type: 'post',
response() {
return { code: 200, msg: 'success', data: data }
},
},
]

85
mock/controller/table.js Normal file
View File

@ -0,0 +1,85 @@
const { mock } = require('mockjs')
const { handleRandomImage } = require('../utils')
const List = []
const count = 999
for (let i = 0; i < count; i++) {
List.push(
mock({
uuid: '@uuid',
id: '@id',
title: '@csentence(1, 2)',
'status|1': ['published', 'draft', 'deleted'],
author: '@cname',
datetime: '@datetime',
pageViews: '@integer(300, 5000)',
img: handleRandomImage(200, 200),
smallImg: handleRandomImage(40, 40),
switch: '@boolean',
percent: '@integer(80,99)',
})
)
}
module.exports = [
{
url: '/table/getList',
type: 'post',
response(config) {
if (!config.body) {
return {
code: 200,
msg: 'success',
totalCount: count,
data: mock({
'data|50': [
{
id: '@id',
title: '@csentence(1, 2)',
'status|1': ['published', 'draft', 'deleted'],
author: '@cname',
datetime: '@datetime',
pageViews: '@integer(300, 5000)',
img: handleRandomImage(200, 200),
smallImg: handleRandomImage(40, 40),
switch: '@boolean',
percent: '@integer(80,99)',
},
],
}).data,
}
}
const { title = '', pageNo = 1, pageSize = 20 } = config.body
let mockList = List.filter((item) => {
return !(title && item.title.indexOf(title) < 0)
})
const pageList = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
totalCount: count,
data: pageList,
}
},
},
{
url: '/table/doEdit',
type: 'post',
response() {
return {
code: 200,
msg: '模拟保存成功',
}
},
},
{
url: '/table/doDelete',
type: 'post',
response() {
return {
code: 200,
msg: '模拟删除成功',
}
},
},
]

54
mock/controller/tree.js Normal file
View File

@ -0,0 +1,54 @@
const data = [
{
id: '1',
parentId: '0',
name: 'root',
title: 'root',
text: 'root',
value: '1',
rank: 1,
children: [
{
id: '32816b88ff72423f960e7d492a386131',
parentId: '1',
name: '一级',
title: '一级',
text: '一级',
value: '32816b88ff72423f960e7d492a386131',
rank: 2,
children: [
{
id: '9e11afc35d55475fb0bd3164b9684cbe',
parentId: '32816b88ff72423f960e7d492a386131',
name: '二级',
title: '二级',
text: '二级',
value: '9e11afc35d55475fb0bd3164b9684cbe',
rank: 3,
children: [
{
id: '4cc1b04635e4444292526c5391699077',
parentId: '9e11afc35d55475fb0bd3164b9684cbe',
name: '三级',
title: '三级',
text: '三级',
value: '4cc1b04635e4444292526c5391699077',
rank: 4,
children: [],
},
],
},
],
},
],
},
]
module.exports = [
{
url: '/tree/list',
type: 'post',
response() {
return { code: 200, msg: 'success', data }
},
},
]

92
mock/controller/user.js Normal file
View File

@ -0,0 +1,92 @@
const accessTokens = {
admin: 'admin-accessToken',
editor: 'editor-accessToken',
test: 'test-accessToken',
}
module.exports = [
{
url: '/publicKey',
type: 'post',
response() {
return {
code: 200,
msg: 'success',
data: {
mockServer: true,
publicKey:
'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBT2vr+dhZElF73FJ6xiP181txKWUSNLPQQlid6DUJhGAOZblluafIdLmnUyKE8mMHhT3R+Ib3ssZcJku6Hn72yHYj/qPkCGFv0eFo7G+GJfDIUeDyalBN0QsuiE/XzPHJBuJDfRArOiWvH0BXOv5kpeXSXM8yTt5Na1jAYSiQ/wIDAQAB',
},
}
},
},
{
url: '/login',
type: 'post',
response(config) {
const { username } = config.body
const accessToken = accessTokens[username]
if (!accessToken) {
return {
code: 500,
msg: '帐户或密码不正确。',
}
}
return {
code: 200,
msg: 'success',
data: { accessToken },
}
},
},
{
url: '/register',
type: 'post',
response() {
return {
code: 200,
msg: '模拟注册成功',
}
},
},
{
url: '/userInfo',
type: 'post',
response(config) {
const { accessToken } = config.body
let permissions = ['admin']
let username = 'admin'
if ('admin-accessToken' === accessToken) {
permissions = ['admin']
username = 'admin'
}
if ('editor-accessToken' === accessToken) {
permissions = ['editor']
username = 'editor'
}
if ('test-accessToken' === accessToken) {
permissions = ['admin', 'editor']
username = 'test'
}
return {
code: 200,
msg: 'success',
data: {
permissions,
username,
'avatar|1': ['https://gcore.jsdelivr.net/gh/zxwk1998/image/avatar/avatar_1.png'],
},
}
},
},
{
url: '/logout',
type: 'post',
response() {
return {
code: 200,
msg: 'success',
}
},
},
]

View File

@ -0,0 +1,67 @@
const totalCount = 3
const List = [
{
id: '@id',
username: 'admin',
password: 'admin',
email: '@email',
permissions: ['admin'],
datatime: '@datetime',
},
{
id: '@id',
username: 'editor',
password: 'editor',
email: '@email',
permissions: ['editor'],
datatime: '@datetime',
},
{
id: '@id',
username: 'test',
password: 'test',
email: '@email',
permissions: ['admin', 'editor'],
datatime: '@datetime',
},
]
module.exports = [
{
url: '/userManagement/getList',
type: 'post',
response(config) {
const { title = '', pageNo = 1, pageSize = 20 } = config.body
let mockList = List.filter((item) => {
if (title && item.title.indexOf(title) < 0) return false
return true
})
const pageList = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
totalCount,
data: pageList,
}
},
},
{
url: '/userManagement/doEdit',
type: 'post',
response() {
return {
code: 200,
msg: '模拟保存成功',
}
},
},
{
url: '/userManagement/doDelete',
type: 'post',
response() {
return {
code: 200,
msg: '模拟删除成功',
}
},
},
]

101
mock/index.js Normal file
View File

@ -0,0 +1,101 @@
const chokidar = require('chokidar')
const bodyParser = require('body-parser')
const chalk = require('chalk')
const path = require('path')
const { mock } = require('mockjs')
const { baseURL } = require('../src/config')
const mockDir = path.join(process.cwd(), 'mock')
const { handleMockArray } = require('./utils')
/**
*
* @param app
* @returns {{mockStartIndex: number, mockRoutesLength: number}}
*/
const registerRoutes = (app) => {
let mockLastIndex
const mocks = []
const mockArray = handleMockArray()
mockArray.forEach((item) => {
const obj = require(item)
mocks.push(...obj)
})
const mocksForServer = mocks.map((route) => {
return responseFake(route.url, route.type, route.response)
})
for (const mock of mocksForServer) {
app[mock.type](mock.url, mock.response)
mockLastIndex = app._router.stack.length
}
const mockRoutesLength = Object.keys(mocksForServer).length
return {
mockRoutesLength: mockRoutesLength,
mockStartIndex: mockLastIndex - mockRoutesLength,
}
}
/**
*
* @param url
* @param type
* @param respond
* @returns {{response(*=, *=): void, type: (*|string), url: RegExp}}
*/
const responseFake = (url, type, respond) => {
// 处理baseURL和url确保不会出现双斜杠
const base = baseURL.endsWith('/') ? baseURL.slice(0, -1) : baseURL
const apiUrl = url.startsWith('/') ? url : `/${url}`
return {
url: new RegExp(`${base}${apiUrl}`),
type: type || 'get',
response(req, res) {
res.status(200)
if (JSON.stringify(req.body) !== '{}') {
console.log(chalk.green(`> 请求地址:${req.path}`))
console.log(chalk.green(`> 请求参数:${JSON.stringify(req.body)}\n`))
} else {
console.log(chalk.green(`> 请求地址:${req.path}\n`))
}
res.json(mock(respond instanceof Function ? respond(req, res) : respond))
},
}
}
/**
*
* @param app
*/
module.exports = (app) => {
app.use(bodyParser.json())
app.use(
bodyParser.urlencoded({
extended: true,
})
)
const mockRoutes = registerRoutes(app)
let mockRoutesLength = mockRoutes.mockRoutesLength
let mockStartIndex = mockRoutes.mockStartIndex
chokidar
.watch(mockDir, {
ignored: /mock-server/,
ignoreInitial: true,
})
.on('all', (event) => {
if (event === 'change' || event === 'add') {
try {
app._router.stack.splice(mockStartIndex, mockRoutesLength)
Object.keys(require.cache).forEach((item) => {
if (item.includes(mockDir)) {
delete require.cache[require.resolve(item)]
}
})
const mockRoutes = registerRoutes(app)
mockRoutesLength = mockRoutes.mockRoutesLength
mockStartIndex = mockRoutes.mockStartIndex
} catch (error) {
console.log(chalk.red(error))
}
}
})
}

44
mock/utils/index.js Normal file
View File

@ -0,0 +1,44 @@
const { Random } = require('mockjs')
const { join } = require('path')
const fs = require('fs')
/**
* @author https://github.com/zxwk1998/vue-admin-better 不想保留author可删除
* @description 随机生成图片url。
* @param width
* @param height
* @returns {string}
*/
function handleRandomImage(width = 50, height = 50) {
return `https://picsum.photos/${width}/${height}?random=${Random.guid()}`
}
/**
* @author https://github.com/zxwk1998/vue-admin-better 不想保留author可删除
* @description 处理所有 controller 模块npm run serve时在node环境中自动输出controller文件夹下Mock接口请勿修改。
* @returns {[]}
*/
function handleMockArray() {
const mockArray = []
const getFiles = (jsonPath) => {
const jsonFiles = []
const findJsonFile = (path) => {
const files = fs.readdirSync(path)
files.forEach((item) => {
const fPath = join(path, item)
const stat = fs.statSync(fPath)
if (stat.isDirectory() === true) findJsonFile(item)
if (stat.isFile() === true) jsonFiles.push(item)
})
}
findJsonFile(jsonPath)
jsonFiles.forEach((item) => mockArray.push(`./controller/${item}`))
}
getFiles('mock/controller')
return mockArray
}
module.exports = {
handleRandomImage,
handleMockArray,
}

View File

@ -1,115 +1,98 @@
{
"name": "eladmin-web",
"version": "2.7.0",
"description": "ELADMIN 前端源码",
"author": "Zheng Jie",
"license": "Apache-2.0",
"name": "vue-admin-better",
"version": "3.0.0",
"author": "zxwk1998",
"participants": [],
"homepage": "https://vuejs-core.cn",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml",
"new": "plop"
"serve:rspack": "node --no-deprecation rspack.js serve",
"build": "node --no-deprecation rspack.js build",
"print-info": "node -e \"require('./layouts').donationConsole()\"",
"lint": "eslint {src,mock,library}/**/*.{vue,js} --fix",
"lint:prettier": "prettier {src,mock,library}/**/*.{html,vue,css,sass,scss,js,ts,md} --write",
"clear": "rimraf node_modules&&npm install --registry=--registry=https://registry.npmmirror.com",
"update": "ncu -u --reject vue-loader,vue-echarts,webpack,eslint-plugin-prettier,@vue/eslint-config-prettier,prettier,layouts,sass-loader,sass,screenfull,eslint,chalk,vue,vue-template-compiler,vue-router,vuex,@vue/cli-plugin-babel,@vue/cli-plugin-eslint,@vue/cli-service,eslint-plugin-vue --registry=https://registry.npmmirror.com&&pnpm i",
"push": "start ./push.sh"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"repository": {
"type": "git",
"url": "git+https://github.com/zxwk1998/vue-admin-better.git"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"*.{js,jsx,vue}": [
"eslint --fix",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/elunez/eladmin-web.git"
},
"bugs": {
"url": "https://github.com/elunez/eladmin/issues"
},
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"axios": "1.8.2",
"clipboard": "2.0.4",
"codemirror": "^5.49.2",
"core-js": "^2.6.12",
"echarts": "^4.2.1",
"echarts-wordcloud": "^1.1.3",
"axios": "^1.11.0",
"caniuse-lite": "^1.0.30001734",
"clipboard": "^2.0.11",
"core-js": "^3.45.0",
"dayjs": "^1.11.13",
"echarts": "6.0.0",
"element-ui": "^2.15.14",
"file-saver": "1.3.8",
"fuse.js": "3.4.4",
"js-beautify": "^1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "^3.7.1",
"mavon-editor": "^2.9.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "8.0.0",
"qs": "^6.10.1",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"vue": "2.7.16",
"vue-count-to": "^1.0.13",
"vue-cropper": "0.4.9",
"vue-echarts": "^5.0.0-beta.0",
"vue-image-crop-upload": "^2.5.0",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"wangeditor": "^4.7.11",
"webpack": "4.47.0"
"jsencrypt": "^3.3.2",
"layouts": "file:layouts",
"lodash": "^4.17.21",
"marked": "^16.1.2",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"qrcode": "^1.5.4",
"qs": "^6.14.0",
"screenfull": "^5.2.0",
"sortablejs": "^1.15.6",
"vab-icon": "file:vab-icon",
"vue": "~2.7.14",
"vue-echarts": "6.7.3",
"vue-router": "^3.6.5",
"vuex": "^3.6.2"
},
"devDependencies": {
"@babel/parser": "^7.7.4",
"@babel/register": "7.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"compression-webpack-plugin": "5.0.2",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^3.0.5",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"plop": "2.3.0",
"sass": "1.32.13",
"sass-loader": "10.2.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "1.16.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"tasksfile": "^5.1.1",
"vue-template-compiler": "2.7.16"
"@rspack/cli": "^1.4.11",
"@rspack/core": "^1.4.11",
"@rspack/dev-server": "^1.1.4",
"@vue/cli-plugin-babel": "^5.0.8",
"archiver": "^7.0.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^10.0.0",
"body-parser": "^2.2.0",
"chalk": "^4.1.2",
"chokidar": "^4.0.3",
"css-loader": "^7.1.2",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-vue": "^9.1.1",
"fs-extra": "^11.3.1",
"html-rspack-plugin": "^6.1.2",
"lint-staged": "^16.1.5",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
"sass": "~1.32.13",
"sass-loader": "^10.1.1",
"style-loader": "^4.0.0",
"stylelint": "^16.23.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recess-order": "^7.2.0",
"vue-loader": "15.9.8",
"vue-template-compiler": "~2.7.14"
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"vue-admin",
"element-admin",
"boilerplate",
"admin-template",
"management-system"
],
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
}

View File

@ -1,7 +0,0 @@
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
module.exports = function(plop) {
plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator)
}

10558
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}

20
prettier.config.js Normal file
View File

@ -0,0 +1,20 @@
/**
* @author https://vuejs-core.cn 不想保留author可删除
* @description 代码规范
*/
module.exports = {
printWidth: 140,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'es5',
bracketSpacing: true,
arrowParens: 'always',
htmlWhitespaceSensitivity: 'ignore',
vueIndentScriptAndStyle: true,
endOfLine: 'lf',
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/favicon_backup.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,15 +1,42 @@
<!DOCTYPE html>
<html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<meta charset="utf-8" />
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
<link href="<%= BASE_URL %>favicon.ico" rel="icon" />
<meta content="vue shop vite 源码,vue admin pro 源码,vue admin plus 源码" name="keywords" />
<meta content="<%= VUE_APP_AUTHOR %>" name="author" />
<link href="<%= BASE_URL %>static/css/loading.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
<noscript>非常抱歉鉴于安全考量,您无法查看<%= VUE_APP_TITLE %> 源代码该系统基于vue-admin-better开发</noscript>
<div id="vue-admin-better">
<div class="first-loading-wrp">
<div class="loading-wrp">
<span class="dot dot-spin">
<i></i>
<i></i>
<i></i>
<i></i>
</span>
</div>
<h1><%= VUE_APP_TITLE %></h1>
</div>
</div>
<script>
;/^http(s*):\/\//.test(location.href) || alert('基于vue-admin-beautiful-pro开源版开发的项目需要部署到服务器下访问')
</script>
<script>
if (window.location.hostname !== 'localhost') {
var _hmt = _hmt || []
;(function () {
var hm = document.createElement('script')
hm.src = 'https://hm.baidu.com/hm.js?7174bade1219f9cc272e7978f9523fc8'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})()
}
</script>
</body>
</html>

View File

@ -1,2 +1,2 @@
User-agent: *
Disallow: /
Allow: /

View File

@ -0,0 +1,99 @@
/**
* @description 雪花屏代码基于ant-design修改
**/
.first-loading-wrp {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 90vh;
min-height: 90vh;
}
.first-loading-wrp > h1 {
font-size: 30px;
font-weight: bolder;
}
.first-loading-wrp .loading-wrp {
display: flex;
align-items: center;
justify-content: center;
padding: 98px;
}
.dot {
position: relative;
box-sizing: border-box;
display: inline-block;
width: 64px;
height: 64px;
font-size: 64px;
transform: rotate(45deg);
animation: antRotate 1.2s infinite linear;
}
.dot i {
position: absolute;
display: block;
width: 28px;
height: 28px;
background-color: #508CF0;
border-radius: 100%;
opacity: 0.3;
transform: scale(0.75);
transform-origin: 50% 50%;
animation: antSpinMove 1s infinite linear alternate;
}
.dot i:nth-child(1) {
top: 0;
left: 0;
}
.dot i:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.dot i:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.dot i:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antSpinMove {
to {
opacity: 1;
}
}
@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}

12
push.sh Normal file
View File

@ -0,0 +1,12 @@
#强制推送
#!/usr/bin/env bash
set -e
git init
git add -A
git commit -m '🎉 feat: init project'
git push -f "https://${access_token}@github.com/zxwk1998/vue-admin-better.git" master
exec /bin/bash

287
rspack.config.js Normal file
View File

@ -0,0 +1,287 @@
const path = require('path')
const { Configuration, DefinePlugin, BannerPlugin } = require('@rspack/core')
const HtmlRspackPlugin = require('html-rspack-plugin')
const { VueLoaderPlugin } = require('vue-loader')
const { publicPath, assetsDir, outputDir, title, devPort } = require('./src/config')
const dayjs = require('dayjs')
const time = dayjs().format('YYYY-M-D HH:mm:ss')
const fs = require('fs-extra')
const { webpackBanner } = require('./layouts')
// 设置环境变量
process.env.VUE_APP_TITLE = title || 'Wagoo'
process.env.VUE_APP_UPDATE_TIME = time
process.env.BASE_URL = publicPath
// 删除这一行避免覆盖rspack.js中设置的值
// process.env.NODE_ENV = process.env.NODE_ENV || 'development'
process.env.VUE_APP_MOCK_ENABLE = 'false' // 启用mock
process.env.VUE_APP_AUTHOR = 'Wagoo' // 设置作者
const resolve = (dir) => path.join(__dirname, dir)
// 定义一个模式变量,避免冲突
const mode = process.env.NODE_ENV || 'development'
/**
* @type {Configuration}
*/
module.exports = {
mode: mode,
context: __dirname,
entry: {
app: './src/main.js',
},
output: {
path: resolve(outputDir),
publicPath: publicPath,
filename: 'js/[name].[contenthash:8].js',
chunkFilename: 'js/[name].[contenthash:8].js',
assetModuleFilename: `${assetsDir}/[name].[hash][ext][query]`,
},
// 增加性能提示配置
performance: {
// 提高阈值以减少警告
maxEntrypointSize: 3000000, // 3MB
maxAssetSize: 1000000, // 1MB
// 只在生产环境显示性能警告
hints: mode === 'production' ? 'warning' : false,
},
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
compilerOptions: {
preserveWhitespace: false,
},
},
},
],
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@vue/cli-plugin-babel/preset'],
},
},
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: {
auto: true,
localIdentName: '[path][name]__[local]--[hash:base64:5]',
},
},
},
{
loader: 'sass-loader',
options: {
additionalData: (content, loaderContext) => {
const { resourcePath, rootContext } = loaderContext
const relativePath = path.relative(rootContext, resourcePath)
if (relativePath.replace(/\\/g, '/') !== 'src/styles/variables.scss') {
return `@import "~@/styles/variables.scss";${content}`
}
return content
},
},
},
],
},
{
test: /\.(png|jpe?g|gif|svg)$/,
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: 10 * 1024, // 10KB
},
},
},
{
test: /\.(woff2?|eot|ttf|otf)$/,
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: 30 * 1024, // 增加到30KB
},
},
},
{
resourceQuery: /raw/,
type: 'asset/source',
},
],
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src'),
vue$: 'vue/dist/vue.esm.js',
path: 'path-browserify',
fs: false,
},
fallback: {
path: require.resolve('path-browserify'),
},
},
plugins: [
new VueLoaderPlugin(),
new DefinePlugin({
// 完全移除可能引起冲突的NODE_ENV定义让rspack.js来处理
'process.env.BASE_URL': JSON.stringify(process.env.BASE_URL),
'process.env.VUE_APP_TITLE': JSON.stringify(process.env.VUE_APP_TITLE),
'process.env.VUE_APP_MOCK_ENABLE': JSON.stringify(process.env.VUE_APP_MOCK_ENABLE),
'process.env.VUE_APP_AUTHOR': JSON.stringify(process.env.VUE_APP_AUTHOR),
'process.env.VUE_APP_UPDATE_TIME': JSON.stringify(process.env.VUE_APP_UPDATE_TIME),
}),
new HtmlRspackPlugin({
template: './public/index.html',
filename: 'index.html',
title: title || 'vue-admin-better',
inject: 'body',
templateParameters: {
BASE_URL: publicPath,
VUE_APP_TITLE: process.env.VUE_APP_TITLE,
VUE_APP_AUTHOR: process.env.VUE_APP_AUTHOR,
},
minify:
mode === 'production'
? {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
collapseBooleanAttributes: true,
removeScriptTypeAttributes: true,
}
: false,
}),
// 添加版权信息到打包文件头部
new BannerPlugin({
banner: webpackBanner(time),
entryOnly: false,
include: /\.(js|css)$/,
}),
// 添加CopyPlugin功能将public目录下除index.html外的文件复制到dist目录
{
apply(compiler) {
compiler.hooks.afterEmit.tap('CopyPublicFolderPlugin', (compilation) => {
// 确保目标目录存在
const targetPath = path.resolve(__dirname, 'dist');
fs.ensureDirSync(targetPath);
// 复制public目录下的所有文件除了index.html
fs.copySync(
path.resolve(__dirname, 'public'),
targetPath,
{
filter: (src) => {
// 不复制index.html文件因为HtmlRspackPlugin会处理它
return !src.endsWith('index.html');
}
}
);
});
}
}
],
optimization: {
splitChunks: {
automaticNameDelimiter: '-',
chunks: 'all',
// 增加maxInitialRequests以允许更多的初始化块
maxInitialRequests: 6,
// 减小最小块大小,允许更细粒度的分割
minSize: 20000,
cacheGroups: {
chunk: {
name: 'vab-chunk',
test: /[\\/]node_modules[\\/]/,
minSize: 131072,
maxSize: 524288,
chunks: 'async',
minChunks: 2,
priority: 10,
},
vue: {
name: 'vue',
test: /[\\/]node_modules[\\/](vue(.*)|core-js)[\\/]/,
chunks: 'initial',
priority: 20,
},
elementUI: {
name: 'element-ui',
test: /[\\/]node_modules[\\/]element-ui(.*)[\\/]/,
priority: 30,
},
// 单独拆分常用工具库
vendors: {
name: 'vendors',
test: /[\\/]node_modules[\\/](lodash|axios|qs|dayjs)[\\/]/,
chunks: 'all',
priority: 35,
},
// 拆分样式资源
styles: {
name: 'styles',
test: /\.(css|scss)$/,
chunks: 'all',
enforce: true,
priority: 40,
},
extra: {
name: 'vab-layouts',
test: resolve('src/layouts'),
priority: 40,
},
},
},
// 添加压缩配置
minimize: mode === 'production',
// 如果是生产环境增加tree shaking
usedExports: mode === 'production',
},
devServer: {
hot: true,
// 修改端口,避免冲突
port: 8090,
historyApiFallback: true,
static: {
directory: path.join(__dirname, 'public'),
},
client: {
overlay: {
errors: true,
warnings: false,
},
},
open: {
target: ['http://localhost:8090'],
},
setupMiddlewares: (middlewares, devServer) => {
if (!devServer) {
throw new Error('dev-server is not defined')
}
if (process.env.VUE_APP_MOCK_ENABLE === 'true') {
const mockServer = require('./mock/index')
mockServer(devServer.app)
}
return middlewares
},
},
}

205
rspack.js Normal file
View File

@ -0,0 +1,205 @@
#!/usr/bin/env node
// 禁用弃用警告
process.noDeprecation = true
const { rspack } = require('@rspack/core')
const path = require('path')
const fs = require('fs')
// 引入layouts中的donationConsole函数
const { donationConsole } = require('./layouts')
// 在命令行控制台打印信息
donationConsole()
const configPath = path.resolve(__dirname, 'rspack.config.js')
const config = require(configPath)
const mode = process.argv[2] === 'build' ? 'production' : 'development'
// 增加archiver依赖用于创建压缩包
const archiver = require('archiver')
const { promisify } = require('util')
const pipeline = promisify(require('stream').pipeline)
// 增强环境变量设置确保所有编译阶段都使用相同的NODE_ENV值
process.env.NODE_ENV = mode
// 设置webpack特定的环境变量以避免冲突
process.env.WEBPACK_ENV = mode
process.env.BABEL_ENV = mode
console.log('设置环境变量 NODE_ENV =', process.env.NODE_ENV)
// 读取配置
config.mode = mode
if (mode === 'production') {
// 生产环境配置
console.log('正在极速打包中预计用时5秒请稍后...')
// 生产环境下增加额外配置
config.optimization = {
...config.optimization,
moduleIds: 'deterministic', // 稳定的模块ID以优化长期缓存
chunkIds: 'deterministic', // 稳定的chunk ID以优化长期缓存
removeEmptyChunks: true, // 移除空的chunks
}
// 在构建前删除dist目录
const distPath = path.resolve(__dirname, 'dist')
if (fs.existsSync(distPath)) {
fs.rmSync(distPath, { recursive: true })
console.log('已删除旧的dist目录')
}
rspack(config).run((err, stats) => {
if (err) {
console.error(err.stack || err)
if (err.details) {
console.error(err.details)
}
process.exit(1)
return
}
const info = stats.toJson()
if (stats.hasErrors()) {
console.error(info.errors)
}
if (stats.hasWarnings()) {
console.warn(info.warnings)
}
console.log(
stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false,
})
)
// 打包完成后创建压缩包
createArchive()
})
} else {
// 开发环境配置
try {
// 尝试使用rspack的dev server
const { RspackDevServer } = require('@rspack/dev-server')
const compiler = rspack(config)
// 使用rspack.config.js中的所有devServer配置
const devServerOptions = config.devServer || {}
// 设置mock服务器
if (process.env.VUE_APP_MOCK_ENABLE === 'true' && !devServerOptions.setupMiddlewares) {
devServerOptions.setupMiddlewares = (middlewares, devServer) => {
if (!devServer) {
throw new Error('dev-server is not defined')
}
const mockServer = require('./mock/index')
mockServer(devServer.app)
return middlewares
}
}
const server = new RspackDevServer(devServerOptions, compiler)
server.start().catch((err) => {
console.error('启动RspackDevServer失败:', err)
})
} catch (error) {
console.error('加载@rspack/dev-server失败尝试使用webpack-dev-server:', error)
// 如果rspack dev server失败尝试回退到webpack
try {
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const webpackConfig = {
...config,
// 添加webpack特定配置
mode: config.mode,
}
const compiler = webpack(webpackConfig)
const devServerOptions = config.devServer || {}
if (process.env.VUE_APP_MOCK_ENABLE === 'true') {
const originalBefore = devServerOptions.before
devServerOptions.before = (app, server) => {
if (originalBefore) {
originalBefore(app, server)
}
const mockServer = require('./mock/index')
mockServer(app)
}
}
const server = new WebpackDevServer(devServerOptions, compiler)
server.start().catch((err) => {
console.error('启动WebpackDevServer失败:', err)
})
} catch (webpackError) {
console.error('回退到webpack-dev-server也失败:', webpackError)
process.exit(1)
}
}
}
// 创建压缩包的函数
async function createArchive() {
const outputPath = path.resolve(__dirname, 'dist')
// 修改为在dist目录内创建压缩包
const archivePath = path.resolve(__dirname, 'dist', 'dist.zip')
// 检查dist目录是否存在
if (!fs.existsSync(outputPath)) {
console.error('dist目录不存在请先执行构建')
return
}
console.log('正在创建压缩包...')
try {
// 创建写入流
const output = fs.createWriteStream(archivePath)
// 创建archiver实例
const archive = archiver('zip', {
zlib: { level: 9 } // 设置压缩级别
})
// 监听完成事件
output.on('close', function() {
console.log(`压缩包创建完成: ${archivePath}`)
console.log(`压缩包大小: ${(archive.pointer() / 1024 / 1024).toFixed(2)} MB`)
})
// 监听错误事件
archive.on('error', function(err) {
throw err
})
// 关联archiver和输出流
archive.pipe(output)
// 添加整个dist目录到压缩包但排除dist.zip自身
archive.glob('**/*', {
cwd: outputPath,
ignore: 'dist.zip' // 忽略压缩包自身
})
// 完成归档
await archive.finalize()
console.log('打包并压缩完成!')
} catch (error) {
console.error('创建压缩包时出错:', error)
}
}

View File

@ -1,11 +1,12 @@
<template>
<div id="app">
<div id="vue-admin-better">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
export default {
name: 'App',
mounted() {},
}
</script>

8
src/api/ad.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
export function getList() {
return request({
url: 'https://api.vuejs-core.cn/getAd',
method: 'get',
})
}

9
src/api/colorfulIcon.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getIconList(data) {
return request({
url: '/colorfulIcon/getList',
method: 'post',
data,
})
}

View File

@ -1,17 +0,0 @@
import request from '@/utils/request'
import qs from 'qs'
export function initData(url, params) {
return request({
url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export function download(url, params) {
return request({
url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get',
responseType: 'blob'
})
}

View File

@ -1,16 +0,0 @@
import request from '@/utils/request'
export function get(tableName) {
return request({
url: 'api/genConfig/' + tableName,
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/genConfig',
data,
method: 'put'
})
}

View File

@ -1,33 +0,0 @@
import request from '@/utils/request'
export function getAllTable() {
return request({
url: 'api/generator/tables/all',
method: 'get'
})
}
export function generator(tableName, type) {
return request({
url: 'api/generator/' + tableName + '/' + type,
method: 'post',
responseType: type === 2 ? 'blob' : ''
})
}
export function save(data) {
return request({
url: 'api/generator',
data,
method: 'put'
})
}
export function sync(tables) {
return request({
url: 'api/generator/sync',
method: 'post',
data: tables
})
}

19
src/api/github.js Normal file
View File

@ -0,0 +1,19 @@
import request from 'axios'
export function getRepos(params) {
return request({
url: 'https://api.github.com/repos/zxwk1998/vue-admin-better',
method: 'get',
params,
timeout: 10000,
})
}
export function getStargazers(params) {
return request({
url: 'https://api.github.com/repos/zxwk1998/vue-admin-better/stargazers',
method: 'get',
params,
timeout: 10000,
})
}

9
src/api/goodsList.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/goodsList/getList',
method: 'post',
data,
})
}

9
src/api/icon.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getIconList(data) {
return request({
url: '/icon/getList',
method: 'post',
data,
})
}

View File

@ -1,35 +0,0 @@
import request from '@/utils/request'
export function login(username, password, code, uuid) {
return request({
url: 'auth/login',
method: 'post',
data: {
username,
password,
code,
uuid
}
})
}
export function getInfo() {
return request({
url: 'auth/info',
method: 'get'
})
}
export function getCodeImg() {
return request({
url: 'auth/code',
method: 'get'
})
}
export function logout() {
return request({
url: 'auth/logout',
method: 'delete'
})
}

View File

@ -1,27 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/app',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/app',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/app',
method: 'put',
data
})
}
export default { add, edit, del }

View File

@ -1,17 +0,0 @@
import request from '@/utils/request'
export function testDbConnect(data) {
return request({
url: 'api/database/testConnect',
method: 'post',
data
})
}
export function testServerConnect(data) {
return request({
url: 'api/serverDeploy/testConnect',
method: 'post',
data
})
}

View File

@ -1,35 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/database',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/database',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/database',
method: 'put',
data
})
}
export function testDbConnection(data) {
return request({
url: 'api/database/testConnect',
method: 'post',
data
})
}
export default { add, edit, del, testDbConnection }

View File

@ -1,77 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/deploy',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/deploy',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/deploy',
method: 'put',
data
})
}
export function getApps() {
return request({
url: 'api/app',
method: 'get'
})
}
export function getServers() {
return request({
url: 'api/serverDeploy',
method: 'get'
})
}
/**
* 启动服务
* @param data 选中行
*/
export function startServer(data) {
return request({
url: 'api/deploy/startServer',
method: 'post',
data
})
}
/**
* 停止服务
* @param data 选中行
*/
export function stopServer(data) {
return request({
url: 'api/deploy/stopServer',
method: 'post',
data
})
}
/**
* 停止服务
* @param data 选中行
*/
export function serverStatus(data) {
return request({
url: 'api/deploy/serverStatus',
method: 'post',
data
})
}
export default { add, edit, del, stopServer, serverStatus, startServer, getServers, getApps }

View File

@ -1,21 +0,0 @@
import request from '@/utils/request'
export function del(ids) {
return request({
url: 'api/deployHistory',
method: 'delete',
data: ids
})
}
/**
* 版本回退
* @param data 选中行
*/
export function reducte(data) {
return request({
url: 'api/deploy/serverReduction',
method: 'post',
data
})
}

View File

@ -1,27 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/serverDeploy',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/serverDeploy',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/serverDeploy',
method: 'put',
data
})
}
export default { add, edit, del }

8
src/api/markdown.js Normal file
View File

@ -0,0 +1,8 @@
import request from 'axios'
export function getList() {
return request({
url: 'https://gcore.jsdelivr.net/gh/prettier/prettier@master/docs/options.md',
method: 'get',
})
}

25
src/api/menuManagement.js Normal file
View File

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function getTree(data) {
return request({
url: '/menuManagement/getTree',
method: 'post',
data,
})
}
export function doEdit(data) {
return request({
url: '/menuManagement/doEdit',
method: 'post',
data,
})
}
export function doDelete(data) {
return request({
url: '/menuManagement/doDelete',
method: 'post',
data,
})
}

View File

@ -1,22 +0,0 @@
import request from '@/utils/request'
export function getErrDetail(id) {
return request({
url: 'api/logs/error/' + id,
method: 'get'
})
}
export function delAllError() {
return request({
url: 'api/logs/del/error',
method: 'delete'
})
}
export function delAllInfo() {
return request({
url: 'api/logs/del/info',
method: 'delete'
})
}

View File

@ -1,9 +0,0 @@
import request from '@/utils/request'
export function del(keys) {
return request({
url: 'auth/online',
method: 'delete',
data: keys
})
}

17
src/api/notice.js Normal file
View File

@ -0,0 +1,17 @@
import request from '@/utils/request'
export function getNoticeList() {
return request({
url: 'https://api.vuejs-core.cn/getNotice',
method: 'get',
})
}
export function getOrderList() {
return request({
url: 'https://dev.wagoo.pet/wagoo/1.1/membership/types',
method: 'post',
})
}

25
src/api/personalCenter.js Normal file
View File

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/personalCenter/getList',
method: 'post',
data,
})
}
export function doEdit(data) {
return request({
url: '/personalCenter/doEdit',
method: 'post',
data,
})
}
export function doDelete(data) {
return request({
url: '/personalCenter/doDelete',
method: 'post',
data,
})
}

8
src/api/publicKey.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
export function getPublicKey() {
return request({
url: 'wagoo/1.1/recharge/config',
method: 'post',
})
}

9
src/api/remixIcon.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getIconList(data) {
return request({
url: '/remixIcon/getList',
method: 'post',
data,
})
}

25
src/api/roleManagement.js Normal file
View File

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/roleManagement/getList',
method: 'post',
data,
})
}
export function doEdit(data) {
return request({
url: '/roleManagement/doEdit',
method: 'post',
data,
})
}
export function doDelete(data) {
return request({
url: '/roleManagement/doDelete',
method: 'post',
data,
})
}

9
src/api/router.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getRouterList(data) {
return request({
url: '/menu/navigate',
method: 'post',
data,
})
}

View File

@ -1,15 +0,0 @@
import request from '@/utils/request'
export function resetEmail(data) {
return request({
url: 'api/code/resetEmail?email=' + data,
method: 'post'
})
}
export function updatePass(pass) {
return request({
url: 'api/users/updatePass/' + pass,
method: 'get'
})
}

View File

@ -1,45 +0,0 @@
import request from '@/utils/request'
export function getDepts(params) {
return request({
url: 'api/dept',
method: 'get',
params
})
}
export function getDeptSuperior(ids, exclude) {
exclude = exclude !== undefined ? exclude : false
const data = Array.isArray(ids) ? ids : [ids]
return request({
url: 'api/dept/superior?exclude=' + exclude,
method: 'post',
data
})
}
export function add(data) {
return request({
url: 'api/dept',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/dept',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/dept',
method: 'put',
data
})
}
export default { add, edit, del, getDepts, getDeptSuperior }

View File

@ -1,34 +0,0 @@
import request from '@/utils/request'
export function getDicts() {
return request({
url: 'api/dict/all',
method: 'get'
})
}
export function add(data) {
return request({
url: 'api/dict',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/dict/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/dict',
method: 'put',
data
})
}
export default { add, edit, del }

View File

@ -1,52 +0,0 @@
import request from '@/utils/request'
export function get(dictName) {
const params = {
dictName,
page: 0,
size: 9999
}
return request({
url: 'api/dictDetail',
method: 'get',
params
})
}
export function getDictMap(dictName) {
const params = {
dictName,
page: 0,
size: 9999
}
return request({
url: 'api/dictDetail/map',
method: 'get',
params
})
}
export function add(data) {
return request({
url: 'api/dictDetail',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/dictDetail/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/dictDetail',
method: 'put',
data
})
}
export default { add, edit, del }

View File

@ -1,40 +0,0 @@
import request from '@/utils/request'
export function getAllJob() {
const params = {
page: 0,
size: 9999,
enabled: true
}
return request({
url: 'api/job',
method: 'get',
params
})
}
export function add(data) {
return request({
url: 'api/job',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/job',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/job',
method: 'put',
data
})
}
export default { add, edit, del }

View File

@ -1,65 +0,0 @@
import request from '@/utils/request'
export function getMenusTree(pid) {
return request({
url: 'api/menus/lazy?pid=' + pid,
method: 'get'
})
}
export function getMenus(params) {
return request({
url: 'api/menus',
method: 'get',
params
})
}
export function getMenuSuperior(ids) {
const data = Array.isArray(ids) ? ids : [ids]
return request({
url: 'api/menus/superior',
method: 'post',
data
})
}
export function getChild(id) {
return request({
url: 'api/menus/child?id=' + id,
method: 'get'
})
}
export function buildMenus() {
return request({
url: 'api/menus/build',
method: 'get'
})
}
export function add(data) {
return request({
url: 'api/menus',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/menus',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/menus',
method: 'put',
data
})
}
export default { add, edit, del, getMenusTree, getMenuSuperior, getMenus, getChild }

View File

@ -1,57 +0,0 @@
import request from '@/utils/request'
// 获取所有的Role
export function getAll() {
return request({
url: 'api/roles/all',
method: 'get'
})
}
export function add(data) {
return request({
url: 'api/roles',
method: 'post',
data
})
}
export function get(id) {
return request({
url: 'api/roles/' + id,
method: 'get'
})
}
export function getLevel() {
return request({
url: 'api/roles/level',
method: 'get'
})
}
export function del(ids) {
return request({
url: 'api/roles',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/roles',
method: 'put',
data
})
}
export function editMenu(data) {
return request({
url: 'api/roles/menu',
method: 'put',
data
})
}
export default { add, edit, del, get, editMenu, getLevel }

View File

@ -1,41 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/jobs',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/jobs',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/jobs',
method: 'put',
data
})
}
export function updateIsPause(id) {
return request({
url: 'api/jobs/' + id,
method: 'put'
})
}
export function execution(id) {
return request({
url: 'api/jobs/exec/' + id,
method: 'put'
})
}
export default { del, updateIsPause, execution, add, edit }

View File

@ -1,69 +0,0 @@
import request from '@/utils/request'
import { encrypt } from '@/utils/rsaEncrypt'
export function add(data) {
return request({
url: 'api/users',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/users',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/users',
method: 'put',
data
})
}
export function editUser(data) {
return request({
url: 'api/users/center',
method: 'put',
data
})
}
export function updatePass(user) {
const data = {
oldPass: encrypt(user.oldPass),
newPass: encrypt(user.newPass)
}
return request({
url: 'api/users/updatePass/',
method: 'post',
data
})
}
export function resetPwd(ids) {
return request({
url: 'api/users/resetPwd',
method: 'put',
data: ids
})
}
export function updateEmail(form) {
const data = {
password: encrypt(form.pass),
email: form.email
}
return request({
url: 'api/users/updateEmail/' + form.code,
method: 'post',
data
})
}
export default { add, edit, del, resetPwd }

101
src/api/table.js Normal file
View File

@ -0,0 +1,101 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/wagoo/1.1/get/order_details',
method: 'post',
data,
})
}
export function goodsListList(data) {
return request({
url: '/wagoo/1.1/get/membership_instances',
method: 'post',
data,
})
}
export function walletList(data) {
return request({
url: '/wagoo/1.1/get/wallet_instances',
method: 'post',
data,
})
}
export function archiveList(data) {
return request({
url: '/wagoo/1.1/get/pets',
method: 'post',
data,
})
}
export function recordList(data) {
return request({
url: '/wagoo/1.1/get/delivery',
method: 'post',
data,
})
}
export function couponstList(data) {
return request({
url: '/wagoo/1.1/get/coupons',
method: 'post',
data,
})
}
export function additional(data) {
return request({
url: '/wagoo/1.1/get/additional_services',
method: 'post',
data,
})
}
export function distributeEdit(data) {
return request({
url: '/wagoo/1.1/delivery/coupons',
method: 'post',
data,
})
}
export function exportUserOperateAdmin(data, headers) {
return request({
url: '/wagoo/1.1/download/order_details',
method: 'get',
data: data,
})
}
export function doEdit(data) {
return request({
url: '/wagoo/1.1/update/order_details',
method: 'post',
data,
})
}
export function additionalEdit(data) {
return request({
url: '/wagoo/1.1/update/additional_services',
method: 'post',
data,
})
}
export function doDelete(data) {
return request({
url: '/table/doDelete',
method: 'post',
data,
})
}

View File

@ -1,25 +0,0 @@
import request from '@/utils/request'
export function get() {
return request({
url: 'api/aliPay',
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/aliPay',
data,
method: 'put'
})
}
// 支付
export function toAliPay(url, data) {
return request({
url: 'api/' + url,
data,
method: 'post'
})
}

View File

@ -1,24 +0,0 @@
import request from '@/utils/request'
export function get() {
return request({
url: 'api/email',
method: 'get'
})
}
export function update(data) {
return request({
url: 'api/email',
data,
method: 'put'
})
}
export function send(data) {
return request({
url: 'api/email',
data,
method: 'post'
})
}

View File

@ -1,27 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/localStorage',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/localStorage/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/localStorage',
method: 'put',
data
})
}
export default { add, edit, del }

View File

@ -1,18 +0,0 @@
import request from '@/utils/request'
export function download(id) {
return request({
url: 'api/s3Storage/download/' + id,
method: 'get'
})
}
export function del(ids) {
return request({
url: 'api/s3Storage',
method: 'delete',
data: ids
})
}
export default { del, download }

9
src/api/tree.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getTreeList(data) {
return request({
url: '/tree/list',
method: 'post',
data,
})
}

39
src/api/user.js Normal file
View File

@ -0,0 +1,39 @@
import request from '@/utils/request'
import { encryptedData } from '@/utils/encrypt'
import { loginRSA, tokenName } from '@/config'
export async function login(data) {
// if (loginRSA) {
// data = await encryptedData(data)
// }
return request({
url: '/wagoo/1.1/admin/login',
method: 'post',
data,
})
}
export function getUserInfo(accessToken) {
return request({
url: '/wagoo/1.1/get/user_info',
method: 'post',
data: {
[tokenName]: accessToken,
},
})
}
export function logout() {
return request({
url: '/wagoo/1.1/admin/logout',
method: 'post',
})
}
export function register() {
return request({
url: '/register',
method: 'post',
})
}

25
src/api/userManagement.js Normal file
View File

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/userManagement/getList',
method: 'post',
data,
})
}
export function doEdit(data) {
return request({
url: '/userManagement/doEdit',
method: 'post',
data,
})
}
export function doDelete(data) {
return request({
url: '/userManagement/doDelete',
method: 'post',
data,
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Some files were not shown because too many files have changed in this diff Show More