Merge remote-tracking branch 'origin/master' into pgsqlDevelop
# Conflicts: # server/initialize/router.go # server/middleware/cors.go
This commit is contained in:
@@ -15,16 +15,16 @@ import (
|
||||
// 初始化总路由
|
||||
|
||||
func Routers() *gin.Engine {
|
||||
var Router = gin.Default()
|
||||
Router := gin.Default()
|
||||
|
||||
// 如果想要不使用nginx代理前端网页,可以修改 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/assets") // dist里面的静态资源
|
||||
//Router.StaticFile("/", "./dist/index.html") // 前端网页入口页面
|
||||
// Router.LoadHTMLGlob("./dist/*.html") // npm打包成dist的路径
|
||||
// Router.Static("/favicon.ico", "./dist/favicon.ico")
|
||||
// Router.Static("/static", "./dist/assets") // dist里面的静态资源
|
||||
// Router.StaticFile("/", "./dist/index.html") // 前端网页入口页面
|
||||
|
||||
Router.StaticFS(global.GVA_CONFIG.Local.Path, http.Dir(global.GVA_CONFIG.Local.Path)) // 为用户头像和文件提供静态地址
|
||||
// Router.Use(middleware.LoadTls()) // 打开就能玩https了
|
||||
@@ -37,7 +37,7 @@ func Routers() *gin.Engine {
|
||||
global.GVA_LOG.Info("register swagger handler")
|
||||
// 方便统一添加路由组前缀 多服务器上线使用
|
||||
|
||||
//获取路由组实例
|
||||
// 获取路由组实例
|
||||
systemRouter := router.RouterGroupApp.System
|
||||
exampleRouter := router.RouterGroupApp.Example
|
||||
autocodeRouter := router.RouterGroupApp.Autocode
|
||||
|
Reference in New Issue
Block a user