zwxi 1 year ago
parent
commit
5d6ae8c774
1 changed files with 6 additions and 6 deletions
  1. 6 6
      controllers/base_auth.go

+ 6 - 6
controllers/base_auth.go

@@ -211,15 +211,15 @@ func (c *BaseAuthController) Prepare() {
 				for _, s := range apis {
 					apiMap[s] = true
 				}
-				//if !apiMap[uri] {
-				//	c.JSON(models.BaseResponse{Ret: 403, Msg: "无权访问!", ErrMsg: "无权访问!"}, false, false)
-				//	c.StopRun()
-				//	return
-				//}
-				if !strings.Contains(api, uri) {
+				if !apiMap[uri] {
 					c.JSON(models.BaseResponse{Ret: 403, Msg: "无权访问!", ErrMsg: "无权访问!"}, false, false)
 					c.StopRun()
+					return
 				}
+				//if !strings.Contains(api, uri) {
+				//	c.JSON(models.BaseResponse{Ret: 403, Msg: "无权访问!", ErrMsg: "无权访问!"}, false, false)
+				//	c.StopRun()
+				//}
 			}
 
 		} else {