后台格式规范化 引入casbin做鉴权

This commit is contained in:
pixel
2019-12-12 13:21:16 +08:00
parent effab2d2b0
commit 3f17e80944
46 changed files with 576 additions and 338 deletions

View File

@@ -11,9 +11,8 @@ import (
)
var QMLog = logrus.New()
//禁止logrus的输出
func InitLog() {
func InitLog() *logrus.Logger{
src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
if err != nil {
fmt.Println("err", err)
@@ -33,4 +32,5 @@ func InitLog() {
}
lfHook := lfshook.NewHook(writeMap, &logrus.JSONFormatter{})
QMLog.AddHook(lfHook)
return QMLog
}