@@ -121,7 +121,7 @@ func (c *BaseAuthController) Prepare() {
for _, s := range apis {
apiMap[s] = true
}
- if !apiMap[uri] {
+ if !apiMap[uri] || utils.NoAuthApiMap[uri] {
c.JSON(models.BaseResponse{Ret: 403, Msg: "无权访问!", ErrMsg: "无权访问!"}, false, false)
c.StopRun()
return
@@ -48,3 +48,9 @@ const (
UserStatusPotential = 1 //潜在用户
UserStatusFormal = 2 //正式用户
)
+
+// 免验证接口
+var NoAuthApiMap = map[string]bool{
+ "/role/menu/buttons": true,
+ "/role/menu/list": true,
+}