feat✨ : 添加请求无权限log
This commit is contained in:
1 parent
24ab2d9cbe
commit
c0f6fb6b41
1 file changed
+1
-1
@@ -38,7 +38,7 @@ func AuthCheckRole() gin.HandlerFunc {
|
|||||||
log.Infof("msgID[%s] isTrue: %v role: %s method: %s path: %s", msgID, res, v["rolekey"], c.Request.Method, c.Request.URL.Path)
|
log.Infof("msgID[%s] isTrue: %v role: %s method: %s path: %s", msgID, res, v["rolekey"], c.Request.Method, c.Request.URL.Path)
|
||||||
c.Next()
|
c.Next()
|
||||||
} else {
|
} else {
|
||||||
log.Warnf("msgID[%s] isTrue: %v role: %s method: %s path: %s message: %s", msgID, res, v["rolekey"], c.Request.Method, c.Request.URL.Path,"当前请求是没有接口权限的,请管理员确认!")
|
log.Warnf("msgID[%s] isTrue: %v role: %s method: %s path: %s message: %s", msgID, res, v["rolekey"], c.Request.Method, c.Request.URL.Path,"当前request无权限,请管理员确认!")
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"code": 403,
|
"code": 403,
|
||||||
"msg": "对不起,您没有该接口访问权限,请联系管理员",
|
"msg": "对不起,您没有该接口访问权限,请联系管理员",
|
||||||
|
|||||||
Reference in new issue
Block a user