作者 yangfu

注入调试token

... ... @@ -40,7 +40,9 @@ var AuthToken = func(ctx *context.Context) {
accesstoken := ctx.Input.Header(protocol.HeaderAccessToken)
refreshToken := ctx.Input.Header(protocol.HeaderRefreshToken)
mtoken, err = serveauth.ValidJWTToken(accesstoken)
if accesstoken == "123456" && beego.BConfig.RunMode != "prod" {
return
}
if err == nil {
storetoken, err = redisdata.GetLoginToken(mtoken.UID)
if err != nil {
... ...
... ... @@ -85,6 +85,8 @@ func init() {
beego.AddNamespace(nsV1)
beego.AddNamespace(nsAuth)
beego.AddNamespace(nsUcenter)
beego.SetStaticPath("/log", beego.AppConfig.String("log_filename"))
}
//routerPermission 路由对应的权限
... ...
... ... @@ -124,8 +124,10 @@ func getBulletinReceiverIds(orm orm2.Ormer, receivers []protocol.VisibleObject,
}
}
var userCompanyIds []int64
if err = utils.ExecuteQueryAllWithOrmer(orm, &userCompanyIds, fmt.Sprintf(sql1, strings.Join(did, ",")), companyId, companyId); err != nil && err != orm2.ErrNoRows {
return
if len(did) > 0 {
if err = utils.ExecuteQueryAllWithOrmer(orm, &userCompanyIds, fmt.Sprintf(sql1, strings.Join(did, ",")), companyId, companyId); err != nil && err != orm2.ErrNoRows {
return
}
}
if len(userCompanyIds) > 0 {
ids = append(ids, userCompanyIds...)
... ...