作者 tangxvhui

调试

@@ -8,7 +8,7 @@ import ( @@ -8,7 +8,7 @@ import (
8 "oppmg/utils/exceltool" 8 "oppmg/utils/exceltool"
9 "strconv" 9 "strconv"
10 10
11 - // serveauth "oppmg/services/auth" 11 + serveauth "oppmg/services/auth"
12 12
13 "github.com/astaxie/beego" 13 "github.com/astaxie/beego"
14 "github.com/astaxie/beego/context" 14 "github.com/astaxie/beego/context"
@@ -30,18 +30,18 @@ func (this *BaseController) Prepare() { @@ -30,18 +30,18 @@ func (this *BaseController) Prepare() {
30 this.Ctx.WriteString("") 30 this.Ctx.WriteString("")
31 return 31 return
32 } 32 }
33 - // if beego.BConfig.RunMode == "dev" {  
34 - // return  
35 - // }  
36 - // p := fmt.Sprint(this.Ctx.Input.GetData("RouterPattern"))  
37 - // userid := this.GetUserId()  
38 - // companyid := this.GetCompanyId()  
39 - // ok := serveauth.ValidUserPermission(p, userid, companyid)  
40 - // if !ok {  
41 - // msg := protocol.NewMessage("10080")  
42 - // this.ResposeJson(msg)  
43 - // return  
44 - // } 33 + if beego.BConfig.RunMode == "dev" {
  34 + return
  35 + }
  36 + p := fmt.Sprint(this.Ctx.Input.GetData("RouterPattern"))
  37 + userid := this.GetUserId()
  38 + companyid := this.GetCompanyId()
  39 + ok := serveauth.ValidUserPermission(p, userid, companyid)
  40 + if !ok {
  41 + msg := protocol.NewMessage("10080")
  42 + this.ResposeJson(msg)
  43 + return
  44 + }
45 //权限校验 45 //权限校验
46 return 46 return
47 } 47 }
@@ -128,7 +128,6 @@ func GetUserPermission(userid int64, field string) (rbac.PermissionOptionObject, @@ -128,7 +128,6 @@ func GetUserPermission(userid int64, field string) (rbac.PermissionOptionObject,
128 if err != nil { 128 if err != nil {
129 return nil, err 129 return nil, err
130 } 130 }
131 - log.Info("reids DATA===>%s", str)  
132 var permissionObj rbac.PermissionOptionObject 131 var permissionObj rbac.PermissionOptionObject
133 fn, ok := rbac.CodePermissionObject[field] 132 fn, ok := rbac.CodePermissionObject[field]
134 if !ok { 133 if !ok {