From 0e174786bf6c97e0393b8a583e34a1ec4697e035 Mon Sep 17 00:00:00 2001 From: bypanghu Date: Wed, 24 Nov 2021 15:58:43 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=20web=E5=85=A8=E7=AB=AF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0gva=20=E6=9D=83=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/index.html | 13 ++-- web/package.json | 2 + web/src/core/config.js | 47 +++++++++++- web/src/core/gin-vue-admin.js | 26 +++++-- web/src/view/login/index.vue | 53 ++++++++++--- web/vite.config.js | 141 ++++++++++++++++++---------------- web/yarn.lock | 13 ++++ 7 files changed, 201 insertions(+), 94 deletions(-) diff --git a/web/index.html b/web/index.html index 7f114f9b..06ff7d4e 100644 --- a/web/index.html +++ b/web/index.html @@ -1,15 +1,18 @@ - + + - + + -
- +
+ - + + \ No newline at end of file diff --git a/web/package.json b/web/package.json index b32113d5..98a63abc 100644 --- a/web/package.json +++ b/web/package.json @@ -38,12 +38,14 @@ "@vue/compiler-sfc": "^3.1.5", "babel-eslint": "^10.1.0", "babel-plugin-import": "^1.13.3", + "chalk": "^4.1.2", "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-banner": "^0.1.3", "vite-plugin-importer": "^0.2.5" } } diff --git a/web/src/core/config.js b/web/src/core/config.js index 920dc908..3ad93751 100644 --- a/web/src/core/config.js +++ b/web/src/core/config.js @@ -3,8 +3,49 @@ */ const config = { - appName: 'Gin-Vue-Admin', - appLogo: 'https://www.gin-vue-admin.com/img/logo.png' + appName: 'Gin-Vue-Admin', + appLogo: 'https://www.gin-vue-admin.com/img/logo.png', + showViteLogo: true } -export default config + +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 \ No newline at end of file diff --git a/web/src/core/gin-vue-admin.js b/web/src/core/gin-vue-admin.js index 4e31d772..17443d18 100644 --- a/web/src/core/gin-vue-admin.js +++ b/web/src/core/gin-vue-admin.js @@ -7,12 +7,22 @@ import { register } from './global' export const run = function(app) { register(app) - console.log(` - 欢迎使用 Gin-Vue-Admin - 当前版本:V2.4.5 beta - 加群方式:微信:shouzi_1994 QQ群:622360840 - 默认自动化文档地址: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 - `) + console.log( + `%c gva启动完成 %c 当前版本V2.4.6 Apache%c`, + 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff', + 'background:#007aff ;padding: 1px 5px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;', + 'background:transparent' + ) + console.log(`欢迎使用 %c Gin-Vue-Admin %c +%c 微信 %c shouzi_1994 %c +%c QQ群 %c 622360840 %c + `, + 'background:#007aff ;padding: 1px 5px; border-radius: 3px; color: #fff; font-weight: bold;margin-bottom:4px;', + 'background:transparent', + 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff', + 'background:#007aff ;padding: 1px 5px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;;margin-bottom:4px;', + 'background:transparent', + 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff', + 'background:#007aff ;padding: 1px 5px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;;margin-bottom:4px;', + 'background:transparent') } \ No newline at end of file diff --git a/web/src/view/login/index.vue b/web/src/view/login/index.vue index aa49d5c4..e76c022d 100644 --- a/web/src/view/login/index.vue +++ b/web/src/view/login/index.vue @@ -3,10 +3,19 @@