cms前端页面

This commit is contained in:
yxh
2020-10-30 15:07:25 +08:00
parent 509b2aaf1e
commit 1b4a5a3b93
75 changed files with 19758 additions and 466 deletions
+8 -2
View File
@@ -25,6 +25,11 @@ func Auth(r *ghttp.Request) {
/*if r.Method != "GET" {
response.FailJson(true, r, "演示系统禁止操作")
}*/
accessParams := r.GetStrings("accessParams")
accessParamsStr := ""
if len(accessParams) > 0 {
accessParamsStr = "?" + gstr.Join(accessParams, "&")
}
//获取登陆用户id
adminId := user_service.GetLoginID(r)
//获取无需验证权限的用户id
@@ -34,10 +39,9 @@ func Auth(r *ghttp.Request) {
return
}
}
url := gstr.TrimLeft(r.Request.URL.Path, "/")
url := gstr.TrimLeft(r.Request.URL.Path, "/") + accessParamsStr
//获取地址对应的菜单id
menuList, err := auth_service.GetMenuIsStatusList()
if err != nil {
g.Log().Error(err)
response.FailJson(true, r, "请求数据失败")
@@ -81,6 +85,8 @@ func Auth(r *ghttp.Request) {
response.FailJson(true, r, "没有访问权限")
}
}
} else if menu == nil && accessParamsStr != "" {
response.FailJson(true, r, "没有访问权限")
}
r.Middleware.Next()
}