mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
log : update log import
This commit is contained in:
+1
-1
@@ -2,8 +2,8 @@ package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"log"
|
||||
orm "go-admin/global"
|
||||
"go-admin/tools"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/casbin/casbin/v2/model"
|
||||
gormAdapter "github.com/casbin/gorm-adapter/v2"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"log"
|
||||
"go-admin/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package cronjob
|
||||
|
||||
import (
|
||||
"github.com/robfig/cron/v3"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"log"
|
||||
tools2 "go-admin/tools"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package tools
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"log"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user