log : update log import

This commit is contained in:
zhangwenjian committed 2020-07-27 22:37:50 +08:00
1 parent 61d3e7c080
commit 012a82821e
6 files changed
+13 -8

No files matched your search

+8 -3
View File
@@ -1,8 +1,8 @@
package middleware
import (
"fmt"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
mycasbin "go-admin/pkg/casbin"
"go-admin/pkg/jwtauth"
_ "go-admin/pkg/jwtauth"
@@ -19,10 +19,15 @@ func AuthCheckRole() gin.HandlerFunc {
tools.HasError(err, "", 500)
//检查权限
res, err := e.Enforce(v["rolekey"], c.Request.URL.Path, c.Request.Method)
log.Println("----------------", v["rolekey"], c.Request.URL.Path, c.Request.Method)
tools.HasError(err, "", 500)
fmt.Printf("%s [INFO] %s %s %s \r\n",
tools.GetCurrentTimeStr(),
c.Request.Method,
c.Request.URL.Path,
v["rolekey"],
)
if res {
c.Next()
} else {