Browse Source

Merge pull request #673 from flipped-aurora/gva-vue3

前端打包工具更换为vite
main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
dc251dc998
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      server/model/system/sys_user.go
  2. 8
      web/.env.development
  3. 8
      web/.env.production
  4. 15
      web/index.html
  5. 262
      web/package-lock.json
  6. 89
      web/package.json
  7. 2
      web/src/components/customPic/index.vue
  8. 2
      web/src/components/dashbordCharts/echartsLine.vue
  9. 2
      web/src/components/upload/image.vue
  10. 17
      web/src/core/gin-vue-admin.js
  11. 2
      web/src/directive/auth.js
  12. 4
      web/src/router/index.js
  13. 210
      web/src/style/login.scss
  14. 4
      web/src/style/newLogin.scss
  15. 3
      web/src/utils/_import.js
  16. 19
      web/src/utils/asyncRouter.js
  17. 174
      web/src/utils/request.js
  18. 2
      web/src/view/example/breakpoint/breakpoint.vue
  19. 2
      web/src/view/example/excel/excel.vue
  20. 4
      web/src/view/example/upload/upload.vue
  21. 2
      web/src/view/init/index.vue
  22. 4
      web/src/view/layout/aside/asideComponent/index.vue
  23. 2
      web/src/view/layout/aside/index.vue
  24. 14
      web/src/view/layout/index.vue
  25. 6
      web/src/view/person/person.vue
  26. 6
      web/src/view/superAdmin/authority/authority.vue
  27. 2
      web/src/view/superAdmin/menu/menu.vue
  28. 8
      web/src/view/superAdmin/user/user.vue
  29. 2
      web/src/view/systemTools/formCreate/index.vue
  30. 83
      web/vite.config.js
  31. 89
      web/vue.config.js

8
server/model/system/sys_user.go

@ -11,11 +11,11 @@ type SysUser struct {
Username string `json:"userName" gorm:"comment:用户登录名"` // 用户登录名
Password string `json:"-" gorm:"comment:用户登录密码"` // 用户登录密码
NickName string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"` // 用户昵称
SideMode string `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"` // 用户侧边主题
HeaderImg string `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
BaseColor string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"` // 基础颜色
ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"` // 活跃颜色
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
SideMode string `json:"sideMode" gorm:"default:dark;comment:用户角色ID"` // 用户侧边主题
ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:用户角色ID"` // 活跃颜色
BaseColor string `json:"baseColor" gorm:"default:#fff;comment:用户角色ID"` // 基础颜色
Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
}

8
web/.env.development

@ -1,6 +1,6 @@
ENV = 'development'
VUE_APP_CLI_PORT = 8080
VUE_APP_SERVER_PORT = 8888
VUE_APP_BASE_API = /api
VUE_APP_BASE_PATH = http://127.0.0.1
VITE_CLI_PORT = 8080
VITE_SERVER_PORT = 8888
VITE_BASE_API = /api
VITE_BASE_PATH = http://127.0.0.1

8
web/.env.production

@ -1,7 +1,7 @@
ENV = 'production'
VUE_APP_CLI_PORT = 8080
VUE_APP_SERVER_PORT = 8888
VUE_APP_BASE_API = /api
VITE_CLI_PORT = 8080
VITE_SERVER_PORT = 8888
VITE_BASE_API = /api
#下方修改为你的线上ip
VUE_APP_BASE_PATH = http://8.141.61.63
VITE_BASE_PATH = http://8.141.61.63

15
web/index.html

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="favicon.ico">
<title></title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./src/main.js"></script>
</body>
</html>

262
web/package-lock.json

@ -545,6 +545,15 @@
"@babel/helper-plugin-utils": "^7.8.3"
}
},
"@babel/plugin-syntax-import-meta": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz",
"integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.10.4"
}
},
"@babel/plugin-syntax-json-strings": {
"version": "7.8.3",
"resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-json-strings/download/@babel/plugin-syntax-json-strings-7.8.3.tgz",
@ -1064,6 +1073,12 @@
"regenerator-runtime": "^0.13.4"
}
},
"@babel/standalone": {
"version": "7.15.4",
"resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.15.4.tgz",
"integrity": "sha512-UO0QCTFjX5NSuwX/i8+/pesmRPoRTtf46Cpn8VHcXvNinEr2lxqe8Ix10TfU/UK5qsaOrcKk24We8wH1G0nTZA==",
"dev": true
},
"@babel/template": {
"version": "7.14.5",
"resolved": "https://registry.nlark.com/@babel/template/download/@babel/template-7.14.5.tgz",
@ -1471,6 +1486,25 @@
}
}
},
"@vitejs/plugin-legacy": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-1.5.2.tgz",
"integrity": "sha512-b1CaWY/wi7gQZnZaxH+ujPTPb91bEPgnnk7l0WIwxoQtW5UC5MQywRcAbFX+Ise62exXctOMBtsnXKJw2KajXw==",
"dev": true,
"requires": {
"@babel/standalone": "^7.14.9",
"core-js": "^3.16.0",
"magic-string": "^0.25.7",
"regenerator-runtime": "^0.13.9",
"systemjs": "^6.10.2"
}
},
"@vitejs/plugin-vue": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.6.0.tgz",
"integrity": "sha512-n3i8htn8pTg9M+kM3cnEfsPZx/6ngInlTroth6fA1LQTJq5aTVQ8ggaE5pPoAy9vCgHPtcaXMzwpldhqRAkebQ==",
"dev": true
},
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/@vue/babel-helper-vue-jsx-merge-props/download/@vue/babel-helper-vue-jsx-merge-props-1.2.1.tgz?cache=0&sync_timestamp=1602851177883&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vue%2Fbabel-helper-vue-jsx-merge-props%2Fdownload%2F%40vue%2Fbabel-helper-vue-jsx-merge-props-1.2.1.tgz",
@ -1765,62 +1799,11 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
"dotenv": {
"version": "8.6.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz",
"integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==",
"dev": true
},
"ssri": {
"version": "8.0.1",
@ -1830,28 +1813,6 @@
"requires": {
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.5.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz",
"integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
@ -4735,9 +4696,9 @@
}
},
"dotenv": {
"version": "8.6.0",
"resolved": "https://registry.nlark.com/dotenv/download/dotenv-8.6.0.tgz",
"integrity": "sha1-Bhr2ZNGff02PxuT/m1hM4jety4s=",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
"integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
"dev": true
},
"dotenv-expand": {
@ -4970,6 +4931,12 @@
"is-symbol": "^1.0.2"
}
},
"esbuild": {
"version": "0.12.25",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.25.tgz",
"integrity": "sha512-woie0PosbRSoN8gQytrdCzUbS2ByKgO8nD1xCZkEup3D9q92miCze4PqEI9TZDYAuwn6CruEnQpJxgTRWdooAg==",
"dev": true
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npm.taobao.org/escalade/download/escalade-3.1.1.tgz?cache=0&sync_timestamp=1602567260031&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescalade%2Fdownload%2Fescalade-3.1.1.tgz",
@ -9840,6 +9807,15 @@
"inherits": "^2.0.1"
}
},
"rollup": {
"version": "2.56.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz",
"integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
}
},
"run-async": {
"version": "2.4.1",
"resolved": "https://registry.npm.taobao.org/run-async/download/run-async-2.4.1.tgz?cache=0&sync_timestamp=1587966119578&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frun-async%2Fdownload%2Frun-async-2.4.1.tgz",
@ -10811,6 +10787,12 @@
"util.promisify": "~1.0.0"
}
},
"systemjs": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.10.3.tgz",
"integrity": "sha512-mXwfLJdaADqWg1J5+Z0bGQEdcXSe+ePPTfzffMB29aVls5cXveRl0vneSV/19t3SfuUBsAraLP8W/g5u9cmYXA==",
"dev": true
},
"table": {
"version": "5.4.6",
"resolved": "https://registry.nlark.com/table/download/table-5.4.6.tgz",
@ -11542,6 +11524,43 @@
"extsprintf": "^1.2.0"
}
},
"vite": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-2.5.3.tgz",
"integrity": "sha512-1wMDnjflvtTTkMov8O/Xb5+w1/VW/Gw8oCf8f6dqgHn8lMOEqq0SaPtFEQeikFcOKCfSbiU0nEi0LDIx6DNsaQ==",
"dev": true,
"requires": {
"esbuild": "^0.12.17",
"fsevents": "~2.3.2",
"postcss": "^8.3.6",
"resolve": "^1.20.0",
"rollup": "^2.38.5"
},
"dependencies": {
"postcss": {
"version": "8.3.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz",
"integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==",
"dev": true,
"requires": {
"colorette": "^1.2.2",
"nanoid": "^3.1.23",
"source-map-js": "^0.6.2"
}
}
}
},
"vite-plugin-importer": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/vite-plugin-importer/-/vite-plugin-importer-0.2.5.tgz",
"integrity": "sha512-6OtqJmVwnfw8+B4OIh7pIdXs+jLkN7g5PIqmZdpgrMYjIFMiZrcMB1zlyUQSTokKGC90KwXviO/lq1hcUBUG3Q==",
"dev": true,
"requires": {
"@babel/core": "^7.12.17",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"babel-plugin-import": "^1.13.3"
}
},
"vm-browserify": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/vm-browserify/download/vm-browserify-1.1.2.tgz",
@ -11612,6 +11631,87 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.5.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz",
"integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-particle-line": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz",

89
web/package.json

@ -1,44 +1,49 @@
{
"name": "gin-vue-admin",
"version": "2.3.5",
"private": true,
"scripts": {
"serve": "node openDocument.js && vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.5",
"echarts": "4.9.0",
"element-plus": "^1.1.0-beta.8",
"highlight.js": "^10.6.0",
"marked": "^2.0.0",
"mitt": "^3.0.0",
"path": "^0.12.7",
"qs": "^6.8.0",
"quill": "^1.3.7",
"screenfull": "^5.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"spark-md5": "^3.0.1",
"vue": "^3.0.0",
"vue-particle-line": "^0.1.4",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0",
"vuex-persist": "^2.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2"
}
"name": "gin-vue-admin",
"version": "2.3.5",
"private": true,
"scripts": {
"serve": "node openDocument.js && vite --host --mode development",
"build": "vite build --mode production",
"preview": "vite preview"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.5",
"echarts": "4.9.0",
"element-plus": "^1.1.0-beta.8",
"highlight.js": "^10.6.0",
"marked": "^2.0.0",
"mitt": "^3.0.0",
"path": "^0.12.7",
"qs": "^6.8.0",
"quill": "^1.3.7",
"screenfull": "^5.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"spark-md5": "^3.0.1",
"vue": "^3.0.0",
"vue-particle-line": "^0.1.4",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0",
"vuex-persist": "^2.1.0"
},
"devDependencies": {
"@vitejs/plugin-legacy": "^1.4.4",
"@vitejs/plugin-vue": "latest",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.1.5",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3",
"dotenv": "^10.0.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vite": "2",
"vite-plugin-importer": "^0.2.5"
}
}

2
web/src/components/customPic/index.vue

@ -16,7 +16,7 @@
<script>
import { mapGetters } from 'vuex'
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
export default {
name: 'CustomPic',
props: {

2
web/src/components/dashbordCharts/echartsLine.vue

@ -9,7 +9,7 @@
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons')
import 'echarts/theme/macarons'
var dataAxis = []
for (var i = 1; i < 21; i++) {

2
web/src/components/upload/image.vue

@ -17,7 +17,7 @@
</template>
<script>
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
import { mapGetters } from 'vuex'
import ImageCompress from '@/utils/image'
export default {

17
web/src/core/gin-vue-admin.js

@ -1,19 +1,18 @@
/*
* gin-vue-admin web框架组
*
* */
* gin-vue-admin web框架组
*
* */
// 加载网站配置文件夹
import { register } from './global'
export const run = function(app) {
register(app)
console.log(`
register(app)
console.log(`
欢迎使用 Gin-Vue-Admin
当前版本:V2.4.5 alpha
加群方式:微信shouzi_1994 QQ群622360840
默认自动化文档地址:http://127.0.0.1:${process.env.VUE_APP_SERVER_PORT}/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:${process.env.VUE_APP_CLI_PORT}
默认自动化文档地址:http://127.0.0.1:${import.meta.env.VITE_SERVER_PORT}/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:${import.meta.env.VITE_CLI_PORT}
如果项目让您获得了收益希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
`)
}
}

2
web/src/directive/auth.js

@ -3,7 +3,7 @@ import { store } from '@/store'
export const auth = (app) => {
app.directive('auth', {
// 当被绑定的元素插入到 DOM 中时……
bind: function(el, binding) {
mounted: function(el, binding) {
const userInfo = store.getters['user/userInfo']
let type = ''
switch (Object.prototype.toString.call(binding.value)) {

4
web/src/router/index.js

@ -7,12 +7,12 @@ const routes = [{
{
path: '/init',
name: 'Init',
component: () => import('@/view/init/index')
component: () => import('@/view/init/index.vue')
},
{
path: '/login',
name: 'Login',
component: () => import('@/view/login/index')
component: () => import('@/view/login/index.vue')
}
]

210
web/src/style/login.scss

@ -1,134 +1,128 @@
.login-register-box {
height: 100vh;
.login-box {
width: 40vw;
position: absolute;
left: 50%;
margin-left: -22vw;
top: 5vh;
.logo {
height: 35vh;
width: 35vh;
}
width: 40vw;
position: absolute;
left: 50%;
margin-left: -22vw;
top: 5vh;
.logo {
height: 35vh;
width: 35vh;
}
}
}
.link-icon {
}
.link-icon {
width: 20px;
min-width: 20px;
height: 20px;
border-radius: 10px;
}
.vPic {
}
.vPic {
width: 33%;
height: 38px;
float: right !important;
background: #ccc;
img {
cursor: pointer;
vertical-align: middle;
cursor: pointer;
vertical-align: middle;
}
}
.logo_login {
}
.logo_login {
width: 100px;
}
#userLayout.user-layout-wrapper {
}
#userLayout.user-layout-wrapper {
height: 100%;
position: relative;
&.mobile {
.container {
.main {
max-width: 368px;
width: 98%;
.container {
.main {
max-width: 368px;
width: 98%;
}
}
}
}
.container {
position: relative;
overflow: auto;
width: 100%;
min-height: 100%;
background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
background-size: 100%;
padding: 110px 0 144px;
a {
text-decoration: none;
}
.top {
text-align: center;
margin-top: -40px;
.header {
height: 44px;
line-height: 44px;
margin-bottom: 30px;
.badge {
position: absolute;
display: inline-block;
line-height: 1;
vertical-align: middle;
margin-left: -12px;
margin-top: -10px;
opacity: 0.8;
}
.logo {
height: 44px;
vertical-align: top;
margin-right: 16px;
border-style: none;
}
.title {
font-size: 33px;
color: rgba(0, 0, 0, 0.85);
font-family: Avenir, "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: 600;
position: relative;
top: 2px;
}
}
.desc {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
margin-top: 12px;
}
}
.main {
min-width: 260px;
width: 368px;
margin: 0 auto;
}
.footer {
position: relative;
overflow: auto;
width: 100%;
padding: 0 20px;
margin: 40px 0 10px;
text-align: center;
.links {
margin-bottom: 8px;
font-size: 14px;
width: 330px;
display: inline-flex;
flex-direction: row;
justify-content: space-between;
padding-right: 40px;
a {
color: rgba(0, 0, 0, 0.45);
transition: all 0.3s;
}
min-height: 100%;
background: #f0f2f5 url(@/assets/background.svg) no-repeat 50%;
background-size: 100%;
padding: 110px 0 144px;
a {
text-decoration: none;
}
.copyright {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
padding-right: 40px;
.top {
text-align: center;
margin-top: -40px;
.header {
height: 44px;
line-height: 44px;
margin-bottom: 30px;
.badge {
position: absolute;
display: inline-block;
line-height: 1;
vertical-align: middle;
margin-left: -12px;
margin-top: -10px;
opacity: 0.8;
}
.logo {
height: 44px;
vertical-align: top;
margin-right: 16px;
border-style: none;
}
.title {
font-size: 33px;
color: rgba(0, 0, 0, 0.85);
font-family: Avenir, "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: 600;
position: relative;
top: 2px;
}
}
.desc {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
margin-top: 12px;
}
}
.main {
min-width: 260px;
width: 368px;
margin: 0 auto;
}
.footer {
position: relative;
width: 100%;
padding: 0 20px;
margin: 40px 0 10px;
text-align: center;
.links {
margin-bottom: 8px;
font-size: 14px;
width: 330px;
display: inline-flex;
flex-direction: row;
justify-content: space-between;
padding-right: 40px;
a {
color: rgba(0, 0, 0, 0.45);
transition: all 0.3s;
}
}
.copyright {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
padding-right: 40px;
}
}
}
}
}
}

4
web/src/style/newLogin.scss

@ -1,7 +1,7 @@
#userLayout {
margin: 0;
padding: 0;
background-image: url("~@/assets/login_background.jpg");
background-image: url("@/assets/login_background.jpg");
background-size: cover;
width: 100%;
height: 100%;
@ -19,7 +19,7 @@
align-items: center;
justify-content: space-evenly;
.login_panle_right {
background-image: url("~@/assets/login_left.svg");
background-image: url("@/assets/login_left.svg");
background-size: cover;
width: 40%;
height: 60%;

3
web/src/utils/_import.js

@ -1,3 +0,0 @@
module.exports = file => () => {
return import ('@/' + file)
}

19
web/src/utils/asyncRouter.js

@ -1,8 +1,9 @@
const _import = require('./_import') // 获取组件的方法
const modules = import.meta.glob('../view/**/*.vue')
export const asyncRouterHandle = (asyncRouter) => {
asyncRouter.map(item => {
if (item.component) {
item.component = _import(item.component)
item.component = dynamicImport(modules, item.component)
} else {
delete item['component']
}
@ -11,3 +12,17 @@ export const asyncRouterHandle = (asyncRouter) => {
}
})
}
function dynamicImport(
dynamicViewsModules,
component
) {
const keys = Object.keys(dynamicViewsModules)
const matchKeys = keys.filter((key) => {
const k = key.replace('../', '')
return k === component
})
const matchKey = matchKeys[0]
return dynamicViewsModules[matchKey]
}

174
web/src/utils/request.js

@ -4,113 +4,113 @@ import { store } from '@/store'
import { emitter } from '@/utils/bus.js'
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API,
timeout: 99999
baseURL: import.meta.env.VITE_BASE_API,
timeout: 99999
})
let acitveAxios = 0
let timer
const showLoading = () => {
acitveAxios++
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
if (acitveAxios > 0) {
emitter.emit('showLoading')
acitveAxios++
if (timer) {
clearTimeout(timer)
}
}, 400)
timer = setTimeout(() => {
if (acitveAxios > 0) {
emitter.emit('showLoading')
}
}, 400)
}
const closeLoading = () => {
acitveAxios--
if (acitveAxios <= 0) {
clearTimeout(timer)
emitter.emit('closeLoading')
}
}
// http request 拦截器
service.interceptors.request.use(
config => {
if (!config.donNotShowLoading) {
showLoading()
acitveAxios--
if (acitveAxios <= 0) {
clearTimeout(timer)
emitter.emit('closeLoading')
}
}
const token = store.getters['user/token']
const user = store.getters['user/userInfo']
config.data = JSON.stringify(config.data)
config.headers = {
'Content-Type': 'application/json',
'x-token': token,
'x-user-id': user.ID
// http request 拦截器
service.interceptors.request.use(
config => {
if (!config.donNotShowLoading) {
showLoading()
}
const token = store.getters['user/token']
const user = store.getters['user/userInfo']
config.data = JSON.stringify(config.data)
config.headers = {
'Content-Type': 'application/json',
'x-token': token,
'x-user-id': user.ID
}
return config
},
error => {
closeLoading()
ElMessage({
showClose: true,
message: error,
type: 'error'
})
return error
}
return config
},
error => {
closeLoading()
ElMessage({
showClose: true,
message: error,
type: 'error'
})
return error
}
)
// http response 拦截器
service.interceptors.response.use(
response => {
closeLoading()
if (response.headers['new-token']) {
store.commit('user/setToken', response.headers['new-token'])
}
if (response.data.code === 0 || response.headers.success === 'true') {
if (response.headers.msg) {
response.data.msg = decodeURI(response.headers.msg)
}
return response.data
} else {
ElMessage({
showClose: true,
message: response.data.msg,
type: 'error'
})
if (response.data.data && response.data.data.reload) {
store.commit('user/LoginOut')
}
return response.data.msg ? response.data : response
}
},
error => {
closeLoading()
switch (error.response.status) {
case 500:
ElMessageBox.confirm(`
response => {
closeLoading()
if (response.headers['new-token']) {
store.commit('user/setToken', response.headers['new-token'])
}
if (response.data.code === 0 || response.headers.success === 'true') {
if (response.headers.msg) {
response.data.msg = decodeURI(response.headers.msg)
}
return response.data
} else {
ElMessage({
showClose: true,
message: response.data.msg,
type: 'error'
})
if (response.data.data && response.data.data.reload) {
store.commit('user/LoginOut')
}
return response.data.msg ? response.data : response
}
},
error => {
closeLoading()
switch (error.response.status) {
case 500:
ElMessageBox.confirm(`
<p>检测到接口错误${error}</p>
<p>错误码<span style="color:red"> 500 </span>panic使</p>
`, '接口报错', {
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '清理缓存',
cancelButtonText: '取消'
})
.then(() => {
store.commit('user/LoginOut')
})
break
case 404:
ElMessageBox.confirm(`
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '清理缓存',
cancelButtonText: '取消'
})
.then(() => {
store.commit('user/LoginOut')
})
break
case 404:
ElMessageBox.confirm(`
<p>检测到接口错误${error}</p>
<p>错误码<span style="color:red"> 404 </span>api--</p>
`, '接口报错', {
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '我知道了',
cancelButtonText: '取消'
})
break
}
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '我知道了',
cancelButtonText: '取消'
})
break
}
return error
}
return error
}
)
export default service
export default service

2
web/src/view/example/breakpoint/breakpoint.vue

@ -140,7 +140,7 @@ export default {
},
async upLoadFileSlice(item) {
//
await axios.post(process.env.VUE_APP_BASE_API + '/fileUploadAndDownload/breakpointContinue', item.formData)
await axios.post(import.meta.env.VITE_BASE_API + '/fileUploadAndDownload/breakpointContinue', item.formData)
this.waitNum-- //
if (this.waitNum === 0) {
//

2
web/src/view/example/excel/excel.vue

@ -31,7 +31,7 @@
</template>
<script>
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
import { mapGetters } from 'vuex'
import infoList from '@/mixins/infoList'
import { exportExcel, loadExcelData, downloadTemplate } from '@/api/excel'

4
web/src/view/example/upload/upload.vue

@ -67,12 +67,12 @@
</template>
<script>
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
import { mapGetters } from 'vuex'
import infoList from '@/mixins/infoList'
import { getFileList, deleteFile } from '@/api/fileUploadAndDownload'
import { downloadImage } from '@/utils/downloadImg'
import CustomPic from '@/components/customPic'
import CustomPic from '@/components/customPic/index.vue'
import UploadImage from '@/components/upload/image.vue'
export default {
name: 'Upload',

2
web/src/view/init/index.vue

@ -116,7 +116,7 @@ export default {
.init_page{
margin: 0;
padding: 0;
background-image: url("~@/assets/login_background.jpg");
background-image: url("@/assets/login_background.jpg");
background-size: cover;
width: 100%;
height: 100%;

4
web/src/view/layout/aside/asideComponent/index.vue

@ -7,8 +7,8 @@
</template>
<script>
import MenuItem from './menuItem'
import AsyncSubmenu from './asyncSubmenu'
import MenuItem from './menuItem.vue'
import AsyncSubmenu from './asyncSubmenu.vue'
export default {
name: 'AsideComponent',

2
web/src/view/layout/aside/index.vue

@ -24,7 +24,7 @@
<script>
import { mapGetters, mapMutations } from 'vuex'
import AsideComponent from '@/view/layout/aside/asideComponent'
import AsideComponent from '@/view/layout/aside/asideComponent/index.vue'
import { emitter } from '@/utils/bus.js'
export default {

14
web/src/view/layout/index.vue

@ -100,14 +100,14 @@
</template>
<script>
import Aside from '@/view/layout/aside'
import HistoryComponent from '@/view/layout/aside/historyComponent/history'
import Screenfull from '@/view/layout/screenfull'
import Search from '@/view/layout/search/search'
import BottomInfo from '@/view/layout/bottomInfo/bottomInfo'
import Aside from '@/view/layout/aside/index.vue'
import HistoryComponent from '@/view/layout/aside/historyComponent/history.vue'
import Screenfull from '@/view/layout/screenfull/index.vue'
import Search from '@/view/layout/search/search.vue'
import BottomInfo from '@/view/layout/bottomInfo/bottomInfo.vue'
import { mapGetters, mapActions } from 'vuex'
import CustomPic from '@/components/customPic'
import Setting from './setting'
import CustomPic from '@/components/customPic/index.vue'
import Setting from './setting/index.vue'
import { setUserAuthority } from '@/api/user'
import { emitter } from '@/utils/bus.js'
export default {

6
web/src/view/person/person.vue

@ -102,11 +102,11 @@
</template>
<script>
import ChooseImg from '@/components/chooseImg'
import { setUserInfo, changePassword } from '@/api/user'
import ChooseImg from '@/components/chooseImg/index.vue'
import { setUserInfo, changePassword } from '@/api/user.js'
import { mapGetters, mapMutations } from 'vuex'
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
export default {
name: 'Person',
components: {

6
web/src/view/superAdmin/authority/authority.vue

@ -99,9 +99,9 @@ import {
copyAuthority
} from '@/api/authority'
import Menus from '@/view/superAdmin/authority/components/menus'
import Apis from '@/view/superAdmin/authority/components/apis'
import Datas from '@/view/superAdmin/authority/components/datas'
import Menus from '@/view/superAdmin/authority/components/menus.vue'
import Apis from '@/view/superAdmin/authority/components/apis.vue'
import Datas from '@/view/superAdmin/authority/components/datas.vue'
import infoList from '@/mixins/infoList'
export default {

2
web/src/view/superAdmin/menu/menu.vue

@ -193,7 +193,7 @@ import {
getBaseMenuById
} from '@/api/menu'
import infoList from '@/mixins/infoList'
import icon from '@/view/superAdmin/menu/icon'
import icon from '@/view/superAdmin/menu/icon.vue'
export default {
name: 'Menus',
components: {

8
web/src/view/superAdmin/user/user.vue

@ -96,7 +96,7 @@
<script>
// mixins getTableData
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
import {
getUserList,
setUserAuthorities,
@ -106,8 +106,8 @@ import {
import { getAuthorityList } from '@/api/authority'
import infoList from '@/mixins/infoList'
import { mapGetters } from 'vuex'
import CustomPic from '@/components/customPic'
import ChooseImg from '@/components/chooseImg'
import CustomPic from '@/components/customPic/index.vue'
import ChooseImg from '@/components/chooseImg/index.vue'
export default {
name: 'Api',
components: { CustomPic, ChooseImg },
@ -214,6 +214,8 @@ export default {
},
closeAddUserDialog() {
this.$refs.userForm.resetFields()
this.userInfo.headerImg = ''
this.userInfo.authorityIds = []
this.addUserDialog = false
},
addUser() {

2
web/src/view/systemTools/formCreate/index.vue

@ -5,7 +5,7 @@
</template>
<script>
var path = process.env.VUE_APP_BASE_PATH
var path = import.meta.env.VITE_BASE_PATH
export default {
name: 'FormGenerator',
data() {

83
web/vite.config.js

@ -0,0 +1,83 @@
/* eslint-disable */
import legacyPlugin from '@vitejs/plugin-legacy';
// import usePluginImport from 'vite-plugin-importer';
import * as path from 'path';
import * as dotenv from 'dotenv';
import * as fs from 'fs';
import vuePlugin from '@vitejs/plugin-vue';
// @see https://cn.vitejs.dev/config/
export default ({
command,
mode
}) => {
let NODE_ENV = process.env.NODE_ENV || 'development'
let envFiles=[
`.env.${NODE_ENV}`
]
for (const file of envFiles) {
const envConfig = dotenv.parse(fs.readFileSync(file))
for (const k in envConfig) {
process.env[k] = envConfig[k]
}
}
let rollupOptions = {};
let optimizeDeps = {};
let alias = {
'@': path.resolve(__dirname, './src'),
'vue$': 'vue/dist/vue.runtime.esm-bundler.js',
}
let esbuild = {}
return {
base: './', // index.html文件所在位置
root: './', // js导入的资源路径,src
resolve: {
alias,
},
define: {
'process.env': {}
},
server: {
open:true,
port: process.env.VITE_CLI_PORT,
proxy:{
// 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api'
target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径
changeOrigin: true,
rewrite: path => path.replace(new RegExp('^' + process.env.VITE_BASE_API), ''),
}
},
},
build: {
target: 'es2015',
minify: 'terser', // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
manifest: false, // 是否产出maifest.json
sourcemap: false, // 是否产出soucemap.json
outDir: 'dist', // 产出目录
rollupOptions,
},
esbuild,
optimizeDeps,
plugins: [
legacyPlugin({
targets: ['Android > 39', 'Chrome >= 60', 'Safari >= 10.1', 'iOS >= 10.3', 'Firefox >= 54', 'Edge >= 15'],
}), vuePlugin(),
],
css: {
preprocessorOptions: {
less: {
// 支持内联 JavaScript
javascriptEnabled: true,
}
}
},
}
}

89
web/vue.config.js

@ -1,89 +0,0 @@
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 基础配置 详情看文档
publicPath: './',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: process.env.VUE_APP_CLI_PORT,
open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
// 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { // 需要代理的路径 例如 '/api'
target: `${process.env.VUE_APP_BASE_PATH}:${process.env.VUE_APP_SERVER_PORT}/`, // 代理到 目标路径
changeOrigin: true,
pathRewrite: { // 修改路径数据
['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除
}
}
}
},
configureWebpack: {
// @路径走src文件夹
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack(config) {
config
// https://webpack.js.org/configuration/devtool/#development
.when(process.env.NODE_ENV === 'development',
config => config.devtool('cheap-source-map')
)
config
.when(process.env.NODE_ENV !== 'development',
config => {
config.plugin('html')
.tap(args => {
args[0].title = 'GIN-VUE-ADMIN'
return args
})
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /single\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
}
)
}
}
Loading…
Cancel
Save