Merge remote-tracking branch 'origin/master' into pgsqlDevelop

# Conflicts:
#	server/initialize/router.go
#	server/middleware/cors.go
This commit is contained in:
piexlmax
2021-12-13 17:31:27 +08:00
95 changed files with 206 additions and 235 deletions
+2 -2
View File
@@ -1,11 +1,12 @@
package initialize
import (
"os"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
"os"
"go.uber.org/zap"
"gorm.io/gorm"
@@ -51,7 +52,6 @@ func RegisterTables(db *gorm.DB) {
autocode.AutoCodeExample{},
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
)
if err != nil {
global.GVA_LOG.Error("register table failed", zap.Error(err))
os.Exit(0)
+4 -3
View File
@@ -1,12 +1,13 @@
package internal
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"log"
"os"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"gorm.io/gorm"
"gorm.io/gorm/logger"
)
var Gorm = new(_gorm)
+1
View File
@@ -2,6 +2,7 @@ package internal
import (
"fmt"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"gorm.io/gorm/logger"
)
-1
View File
@@ -31,5 +31,4 @@ func InstallPlugin(PublicGroup *gin.RouterGroup, PrivateGroup *gin.RouterGroup)
global.GVA_CONFIG.Email.Port,
global.GVA_CONFIG.Email.IsSSL,
))
}
+6 -6
View File
@@ -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