兼容casbin2.24.0版本log
迁移脚本编译时不打包
This commit is contained in:
1 parent
48f0cb46ec
commit
39dd1ee6f8
56 files changed
+320
-454
No files matched your search
+6
-1
@@ -22,7 +22,12 @@ func (e *Api) GetLogger(c *gin.Context) logger.Logger {
|
||||
|
||||
// GetOrm 获取Orm DB
|
||||
func (e *Api) GetOrm(c *gin.Context) (*gorm.DB, error) {
|
||||
return tools.GetOrm(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
if err != nil {
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
return nil, err
|
||||
}
|
||||
return db, nil
|
||||
}
|
||||
|
||||
// Error 通常错误数据处理
|
||||
|
||||
Reference in new issue
Block a user