Merge pull request #527 from songzhibin97/gva_gormv2_dev

perf:优化初始化流程
This commit is contained in:
奇淼(piexlmax
2021-06-17 15:14:08 +08:00
committed by GitHub
2 changed files with 13 additions and 23 deletions

View File

@@ -5,6 +5,7 @@ import (
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"go.uber.org/zap"
"github.com/gin-gonic/gin"
@@ -30,7 +31,7 @@ func InitDB(c *gin.Context) {
}
if err := service.InitDB(dbInfo); err != nil {
global.GVA_LOG.Error("自动创建数据库失败!", zap.Any("err", err))
response.FailWithMessage("自动创建数据库失败,请查看后台日志", c)
response.FailWithMessage("自动创建数据库失败,请查看后台日志,检查后在进行初始化", c)
return
}
response.OkWithData("自动创建数据库成功", c)