Browse Source

Merge branch 'develop' of github.com:flipped-aurora/gin-vue-admin into gva-vue3-2.4.5

main
qimiao 3 years ago
parent
commit
28445308a5
  1. 10
      server/initialize/router.go

10
server/initialize/router.go

@ -16,6 +16,16 @@ import (
func Routers() *gin.Engine { func Routers() *gin.Engine {
var Router = gin.Default() var Router = gin.Default()
// 想代理前端网页,修改 web/.env.production 下的
// VUE_APP_BASE_API = /
// VUE_APP_BASE_PATH = http://localhost
// 然后执行打包命令 npm run build。在打开下面4行注释
//Router.LoadHTMLGlob("./dist/*.html") // npm打包成dist的路径
//Router.Static("/favicon.ico", "./dist/favicon.ico")
//Router.Static("/static", "./dist/static") // dist里面的静态资源
//Router.StaticFile("/", "./dist/index.html") // 前端网页入口页面
Router.StaticFS(global.GVA_CONFIG.Local.Path, http.Dir(global.GVA_CONFIG.Local.Path)) // 为用户头像和文件提供静态地址 Router.StaticFS(global.GVA_CONFIG.Local.Path, http.Dir(global.GVA_CONFIG.Local.Path)) // 为用户头像和文件提供静态地址
// Router.Use(middleware.LoadTls()) // 打开就能玩https了 // Router.Use(middleware.LoadTls()) // 打开就能玩https了
global.GVA_LOG.Info("use middleware logger") global.GVA_LOG.Info("use middleware logger")

Loading…
Cancel
Save