log : update log import
This commit is contained in:
1 parent
61d3e7c080
commit
012a82821e
6 files changed
+13
-8
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user