mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
log : update log import
This commit is contained in:
+1
-1
@@ -2,8 +2,8 @@ package handler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
jwt "go-admin/pkg/jwtauth"
|
jwt "go-admin/pkg/jwtauth"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package middleware
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
mycasbin "go-admin/pkg/casbin"
|
mycasbin "go-admin/pkg/casbin"
|
||||||
"go-admin/pkg/jwtauth"
|
"go-admin/pkg/jwtauth"
|
||||||
_ "go-admin/pkg/jwtauth"
|
_ "go-admin/pkg/jwtauth"
|
||||||
@@ -19,10 +19,15 @@ func AuthCheckRole() gin.HandlerFunc {
|
|||||||
tools.HasError(err, "", 500)
|
tools.HasError(err, "", 500)
|
||||||
//检查权限
|
//检查权限
|
||||||
res, err := e.Enforce(v["rolekey"], c.Request.URL.Path, c.Request.Method)
|
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)
|
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 {
|
if res {
|
||||||
c.Next()
|
c.Next()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
log "github.com/sirupsen/logrus"
|
"log"
|
||||||
orm "go-admin/global"
|
orm "go-admin/global"
|
||||||
"go-admin/tools"
|
"go-admin/tools"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/casbin/casbin/v2/model"
|
"github.com/casbin/casbin/v2/model"
|
||||||
gormAdapter "github.com/casbin/gorm-adapter/v2"
|
gormAdapter "github.com/casbin/gorm-adapter/v2"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
log "github.com/sirupsen/logrus"
|
"log"
|
||||||
"go-admin/global"
|
"go-admin/global"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package cronjob
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
log "github.com/sirupsen/logrus"
|
"log"
|
||||||
tools2 "go-admin/tools"
|
tools2 "go-admin/tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package tools
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
log "github.com/sirupsen/logrus"
|
"log"
|
||||||
jwt "go-admin/pkg/jwtauth"
|
jwt "go-admin/pkg/jwtauth"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user