结构调整添加cmd

This commit is contained in:
zhangwenjian committed 2020-04-18 10:06:44 +08:00
1 parent f2829bfd98
commit a2f4c00246
72 files changed
+838 -597

No files matched your search

+3 -3
View File
@@ -2,10 +2,10 @@ package middleware
import (
"github.com/gin-gonic/gin"
"go-admin/pkg"
mycasbin "go-admin/pkg/casbin"
"go-admin/pkg/jwtauth"
_ "go-admin/pkg/jwtauth"
"go-admin/tools"
"log"
"net/http"
)
@@ -16,12 +16,12 @@ func AuthCheckRole() gin.HandlerFunc {
data, _ := c.Get("JWT_PAYLOAD")
v := data.(jwtauth.MapClaims)
e, err := mycasbin.Casbin()
pkg.HasError(err,"",500)
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)
pkg.HasError(err,"",500)
tools.HasError(err,"",500)
if res {
c.Next()