Browse Source

Merge pull request #816 from bypanghu/master

fixed:gva全局标志
main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
e855c7c12f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      web/index.html
  2. 5
      web/package.json
  3. 43
      web/src/core/config.js
  4. 8
      web/src/view/login/index.vue
  5. 23
      web/vite.config.js
  6. 13
      web/yarn.lock

11
web/index.html

@ -1,15 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta content="Gin,Vue,Admin.Gin-Vue-Admin,GVA,gin-vue-admin,后台管理框架,vue后台管理框架,gin-vue-admin文档,gin-vue-admin首页,gin-vue-admin" name="keywords" />
<link rel="icon" href="favicon.ico"> <link rel="icon" href="favicon.ico">
<title></title> <title></title>
</head>
</head>
<body> <body>
<div id="app"></div>
<script type="module" src="./src/main.js"></script>
<div id="app"></div>
<script type="module" src="./src/main.js"></script>
</body> </body>
</html> </html>

5
web/package.json

@ -8,11 +8,10 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@element-plus/icons": "0.0.11",
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"echarts": "4.9.0", "echarts": "4.9.0",
"element-plus": "^1.1.0-beta.24",
"element-plus": "^1.1.0-beta.8",
"highlight.js": "^10.6.0", "highlight.js": "^10.6.0",
"marked": "^2.0.0", "marked": "^2.0.0",
"mitt": "^3.0.0", "mitt": "^3.0.0",
@ -39,12 +38,14 @@
"@vue/compiler-sfc": "^3.1.5", "@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",
"chalk": "^4.1.2",
"dotenv": "^10.0.0", "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": "2",
"vite-plugin-banner": "^0.1.3",
"vite-plugin-importer": "^0.2.5" "vite-plugin-importer": "^0.2.5"
} }
} }

43
web/src/core/config.js

@ -4,7 +4,48 @@
const config = { const config = {
appName: 'Gin-Vue-Admin', appName: 'Gin-Vue-Admin',
appLogo: 'https://www.gin-vue-admin.com/img/logo.png'
appLogo: 'https://www.gin-vue-admin.com/img/logo.png',
showViteLogo: true
} }
export const viteLogo = (env) => {
if (config.showViteLogo) {
const chalk = require('chalk')
console.log(
chalk.green(
`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`
)
)
console.log(
chalk.green(
`> 当前版本:V2.4.6 Apache`
)
)
console.log(
chalk.green(
`> 加群方式:微信:shouzi_1994 QQ群:622360840`
)
)
console.log(
chalk.green(
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
)
)
console.log(
chalk.green(
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
)
)
console.log(
chalk.green(
`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`
)
)
console.log('\n')
}
}
export default config export default config

8
web/src/view/login/index.vue

@ -84,7 +84,7 @@
</a> </a>
</div> </div>
<div class="copyright"> <div class="copyright">
Copyright &copy; {{ curYear }} 💖 flipped-aurora
<bootomInfo />
</div> </div>
</div> </div>
</div> </div>
@ -94,6 +94,7 @@
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { captcha } from '@/api/user' import { captcha } from '@/api/user'
import { checkDB } from '@/api/initdb' import { checkDB } from '@/api/initdb'
import bootomInfo from '@/view/layout/bottomInfo/bottomInfo.vue'
export default { export default {
name: 'Login', name: 'Login',
data() { data() {
@ -112,7 +113,6 @@ export default {
} }
} }
return { return {
curYear: 0,
lock: 'lock', lock: 'lock',
loginForm: { loginForm: {
username: 'admin', username: 'admin',
@ -133,9 +133,11 @@ export default {
picPath: '' picPath: ''
} }
}, },
components:{
bootomInfo
},
created() { created() {
this.loginVerify() this.loginVerify()
this.curYear = new Date().getFullYear()
}, },
methods: { methods: {
...mapActions('user', ['LoginIn']), ...mapActions('user', ['LoginIn']),

23
web/vite.config.js

@ -1,6 +1,7 @@
/* eslint-disable */
import legacyPlugin from '@vitejs/plugin-legacy'; import legacyPlugin from '@vitejs/plugin-legacy';
// import usePluginImport from 'vite-plugin-importer'; // import usePluginImport from 'vite-plugin-importer';
import { viteLogo } from './src/core/config'
import Banner from 'vite-plugin-banner'
import * as path from 'path'; import * as path from 'path';
import * as dotenv from 'dotenv'; import * as dotenv from 'dotenv';
import * as fs from 'fs'; import * as fs from 'fs';
@ -11,7 +12,7 @@ export default ({
mode mode
}) => { }) => {
let NODE_ENV = process.env.NODE_ENV || 'development' let NODE_ENV = process.env.NODE_ENV || 'development'
let envFiles=[
let envFiles = [
`.env.${NODE_ENV}` `.env.${NODE_ENV}`
] ]
for (const file of envFiles) { for (const file of envFiles) {
@ -21,11 +22,19 @@ export default ({
} }
} }
let rollupOptions = {};
viteLogo(process.env)
let timestamp = Date.parse(new Date())
let optimizeDeps = {};
let rollupOptions = {
output: {
entryFileNames: `gva/gin-vue-admin-[name].${timestamp}.js`,
chunkFileNames: `js/gin-vue-admin-[name].${timestamp}.js`,
assetFileNames: `assets/gin-vue-admin-[name].${timestamp}.[ext]`
}
};
let optimizeDeps = {};
let alias = { let alias = {
'@': path.resolve(__dirname, './src'), '@': path.resolve(__dirname, './src'),
@ -44,9 +53,9 @@ export default ({
'process.env': {} 'process.env': {}
}, },
server: { server: {
open:true,
open: true,
port: process.env.VITE_CLI_PORT, port: process.env.VITE_CLI_PORT,
proxy:{
proxy: {
// 把key的路径代理到target位置 // 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api' [process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api'
@ -69,7 +78,7 @@ export default ({
plugins: [ plugins: [
legacyPlugin({ legacyPlugin({
targets: ['Android > 39', 'Chrome >= 60', 'Safari >= 10.1', 'iOS >= 10.3', 'Firefox >= 54', 'Edge >= 15'], targets: ['Android > 39', 'Chrome >= 60', 'Safari >= 10.1', 'iOS >= 10.3', 'Firefox >= 54', 'Edge >= 15'],
}), vuePlugin(),
}), vuePlugin(), [Banner(`\n Build based on gin-vue-admin \n Time : ${timestamp}`)]
], ],
css: { css: {
preprocessorOptions: { preprocessorOptions: {

13
web/yarn.lock

@ -2648,6 +2648,14 @@ chalk@^4.0.0, chalk@^4.1.0:
ansi-styles "^4.1.0" ansi-styles "^4.1.0"
supports-color "^7.1.0" supports-color "^7.1.0"
chalk@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chardet@^0.7.0: chardet@^0.7.0:
version "0.7.0" version "0.7.0"
resolved "https://registry.nlark.com/chardet/download/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" resolved "https://registry.nlark.com/chardet/download/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
@ -8775,6 +8783,11 @@ verror@1.10.0:
core-util-is "1.0.2" core-util-is "1.0.2"
extsprintf "^1.2.0" extsprintf "^1.2.0"
vite-plugin-banner@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/vite-plugin-banner/-/vite-plugin-banner-0.1.3.tgz#d3d4e8e284added35feaa54ab8ca273a9d3349e0"
integrity sha512-Kbv4KzvhffQwbp3Sr2FA51hFaiEgACGNExYK07hj0m53At2FTnPver2TfGCulDpv4G9B8/flbEOdso3JWWpIEQ==
vite-plugin-importer@^0.2.5: vite-plugin-importer@^0.2.5:
version "0.2.5" version "0.2.5"
resolved "https://registry.nlark.com/vite-plugin-importer/download/vite-plugin-importer-0.2.5.tgz#2363dc0d97d4ecec530ee40171310a17c2db077e" resolved "https://registry.nlark.com/vite-plugin-importer/download/vite-plugin-importer-0.2.5.tgz#2363dc0d97d4ecec530ee40171310a17c2db077e"

Loading…
Cancel
Save