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. 15
      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. 11
      web/src/core/gin-vue-admin.js
  11. 2
      web/src/directive/auth.js
  12. 4
      web/src/router/index.js
  13. 26
      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. 6
      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:用户登录名"` // 用户登录名 Username string `json:"userName" gorm:"comment:用户登录名"` // 用户登录名
Password string `json:"-" gorm:"comment:用户登录密码"` // 用户登录密码 Password string `json:"-" gorm:"comment:用户登录密码"` // 用户登录密码
NickName string `json:"nickName" gorm:"default:系统用户;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:用户头像"` // 用户头像 HeaderImg string `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;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 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"` // 基础颜色
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"` Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
} }

8
web/.env.development

@ -1,6 +1,6 @@
ENV = 'development' 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' 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 #下方修改为你的线上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/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": { "@babel/plugin-syntax-json-strings": {
"version": "7.8.3", "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", "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" "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": { "@babel/template": {
"version": "7.14.5", "version": "7.14.5",
"resolved": "https://registry.nlark.com/@babel/template/download/@babel/template-7.14.5.tgz", "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": { "@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.2.1", "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", "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=", "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true "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": { "ssri": {
"version": "8.0.1", "version": "8.0.1",
@ -1830,28 +1813,6 @@
"requires": { "requires": {
"minipass": "^3.1.1" "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": { "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 "dev": true
}, },
"dotenv-expand": { "dotenv-expand": {
@ -4970,6 +4931,12 @@
"is-symbol": "^1.0.2" "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": { "escalade": {
"version": "3.1.1", "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", "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" "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": { "run-async": {
"version": "2.4.1", "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", "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" "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": { "table": {
"version": "5.4.6", "version": "5.4.6",
"resolved": "https://registry.nlark.com/table/download/table-5.4.6.tgz", "resolved": "https://registry.nlark.com/table/download/table-5.4.6.tgz",
@ -11542,6 +11524,43 @@
"extsprintf": "^1.2.0" "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": { "vm-browserify": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/vm-browserify/download/vm-browserify-1.1.2.tgz", "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": { "vue-particle-line": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz", "resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz",

15
web/package.json

@ -3,9 +3,9 @@
"version": "2.3.5", "version": "2.3.5",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "node openDocument.js && vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"serve": "node openDocument.js && vite --host --mode development",
"build": "vite build --mode production",
"preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
@ -28,17 +28,22 @@
"vuex-persist": "^2.1.0" "vuex-persist": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-legacy": "^1.4.4",
"@vitejs/plugin-vue": "latest",
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0", "@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/compiler-sfc": "^3.1.5",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3", "babel-plugin-import": "^1.13.3",
"dotenv": "^10.0.0",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0", "eslint-plugin-vue": "^7.0.0",
"sass": "^1.26.5", "sass": "^1.26.5",
"sass-loader": "^8.0.2"
"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> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
export default { export default {
name: 'CustomPic', name: 'CustomPic',
props: { props: {

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

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

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

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

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

@ -1,7 +1,7 @@
/* /*
* gin-vue-admin web框架组
*
* */
* gin-vue-admin web框架组
*
* */
// 加载网站配置文件夹 // 加载网站配置文件夹
import { register } from './global' import { register } from './global'
@ -11,9 +11,8 @@ export const run = function(app) {
欢迎使用 Gin-Vue-Admin 欢迎使用 Gin-Vue-Admin
当前版本:V2.4.5 alpha 当前版本:V2.4.5 alpha
加群方式:微信shouzi_1994 QQ群622360840 加群方式:微信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 如果项目让您获得了收益希望您能请团队喝杯可乐: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) => { export const auth = (app) => {
app.directive('auth', { app.directive('auth', {
// 当被绑定的元素插入到 DOM 中时…… // 当被绑定的元素插入到 DOM 中时……
bind: function(el, binding) {
mounted: function(el, binding) {
const userInfo = store.getters['user/userInfo'] const userInfo = store.getters['user/userInfo']
let type = '' let type = ''
switch (Object.prototype.toString.call(binding.value)) { switch (Object.prototype.toString.call(binding.value)) {

4
web/src/router/index.js

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

26
web/src/style/login.scss

@ -11,16 +11,16 @@
width: 35vh; width: 35vh;
} }
} }
}
}
.link-icon {
.link-icon {
width: 20px; width: 20px;
min-width: 20px; min-width: 20px;
height: 20px; height: 20px;
border-radius: 10px; border-radius: 10px;
}
}
.vPic {
.vPic {
width: 33%; width: 33%;
height: 38px; height: 38px;
float: right !important; float: right !important;
@ -29,13 +29,13 @@
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
} }
}
}
.logo_login {
.logo_login {
width: 100px; width: 100px;
}
}
#userLayout.user-layout-wrapper {
#userLayout.user-layout-wrapper {
height: 100%; height: 100%;
position: relative; position: relative;
&.mobile { &.mobile {
@ -46,19 +46,17 @@
} }
} }
} }
.container { .container {
position: relative; position: relative;
overflow: auto; overflow: auto;
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
background: #f0f2f5 url(@/assets/background.svg) no-repeat 50%;
background-size: 100%; background-size: 100%;
padding: 110px 0 144px; padding: 110px 0 144px;
a { a {
text-decoration: none; text-decoration: none;
} }
.top { .top {
text-align: center; text-align: center;
margin-top: -40px; margin-top: -40px;
@ -75,14 +73,12 @@
margin-top: -10px; margin-top: -10px;
opacity: 0.8; opacity: 0.8;
} }
.logo { .logo {
height: 44px; height: 44px;
vertical-align: top; vertical-align: top;
margin-right: 16px; margin-right: 16px;
border-style: none; border-style: none;
} }
.title { .title {
font-size: 33px; font-size: 33px;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
@ -98,13 +94,11 @@
margin-top: 12px; margin-top: 12px;
} }
} }
.main { .main {
min-width: 260px; min-width: 260px;
width: 368px; width: 368px;
margin: 0 auto; margin: 0 auto;
} }
.footer { .footer {
position: relative; position: relative;
width: 100%; width: 100%;
@ -131,4 +125,4 @@
} }
} }
} }
}
}

4
web/src/style/newLogin.scss

@ -1,7 +1,7 @@
#userLayout { #userLayout {
margin: 0; margin: 0;
padding: 0; padding: 0;
background-image: url("~@/assets/login_background.jpg");
background-image: url("@/assets/login_background.jpg");
background-size: cover; background-size: cover;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -19,7 +19,7 @@
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: space-evenly;
.login_panle_right { .login_panle_right {
background-image: url("~@/assets/login_left.svg");
background-image: url("@/assets/login_left.svg");
background-size: cover; background-size: cover;
width: 40%; width: 40%;
height: 60%; 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) => { export const asyncRouterHandle = (asyncRouter) => {
asyncRouter.map(item => { asyncRouter.map(item => {
if (item.component) { if (item.component) {
item.component = _import(item.component)
item.component = dynamicImport(modules, item.component)
} else { } else {
delete item['component'] 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]
}

6
web/src/utils/request.js

@ -4,7 +4,7 @@ import { store } from '@/store'
import { emitter } from '@/utils/bus.js' import { emitter } from '@/utils/bus.js'
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API,
baseURL: import.meta.env.VITE_BASE_API,
timeout: 99999 timeout: 99999
}) })
let acitveAxios = 0 let acitveAxios = 0
@ -27,8 +27,8 @@ const closeLoading = () => {
clearTimeout(timer) clearTimeout(timer)
emitter.emit('closeLoading') emitter.emit('closeLoading')
} }
}
// http request 拦截器
}
// http request 拦截器
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
if (!config.donNotShowLoading) { if (!config.donNotShowLoading) {

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

@ -140,7 +140,7 @@ export default {
}, },
async upLoadFileSlice(item) { 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-- // this.waitNum-- //
if (this.waitNum === 0) { if (this.waitNum === 0) {
// //

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

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

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

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

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

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

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

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

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

@ -24,7 +24,7 @@
<script> <script>
import { mapGetters, mapMutations } from 'vuex' 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' import { emitter } from '@/utils/bus.js'
export default { export default {

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

@ -100,14 +100,14 @@
</template> </template>
<script> <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 { 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 { setUserAuthority } from '@/api/user'
import { emitter } from '@/utils/bus.js' import { emitter } from '@/utils/bus.js'
export default { export default {

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

@ -102,11 +102,11 @@
</template> </template>
<script> <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' import { mapGetters, mapMutations } from 'vuex'
const path = process.env.VUE_APP_BASE_API
const path = import.meta.env.VITE_BASE_API
export default { export default {
name: 'Person', name: 'Person',
components: { components: {

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

@ -99,9 +99,9 @@ import {
copyAuthority copyAuthority
} from '@/api/authority' } 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' import infoList from '@/mixins/infoList'
export default { export default {

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

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

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

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

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

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