|
@@ -54,8 +54,57 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
|
|
|
}
|
|
|
} else {
|
|
|
if entity.ConfigJson.CommonlyIds != "" && len(strings.Split(entity.ConfigJson.CommonlyIds, ",")) > 0 {
|
|
|
+ // 判断用户身份
|
|
|
var ids []string
|
|
|
+ var (
|
|
|
+ entId, _ = strconv.ParseInt(in.EntId, 10, 64)
|
|
|
+ newUserId, _ = strconv.ParseInt(in.NewUserId, 10, 64)
|
|
|
+ entUserId, _ = strconv.ParseInt(in.EntUserId, 10, 64)
|
|
|
+ accountId, _ = strconv.ParseInt(in.AccountId, 10, 64)
|
|
|
+ entAccountId, _ = strconv.ParseInt(in.EntAccountId, 10, 64)
|
|
|
+ positionType, _ = strconv.ParseInt(in.PositionType, 10, 64)
|
|
|
+ positionId, _ = strconv.ParseInt(in.PositionId, 10, 64)
|
|
|
+ )
|
|
|
+ userInfoRpc := entity.UserInfoRpc{
|
|
|
+ AppId: in.AppId,
|
|
|
+ UserId: in.UserId,
|
|
|
+ BaseUserId: newUserId,
|
|
|
+ EntId: entId,
|
|
|
+ EntUserId: entUserId,
|
|
|
+ AccountId: accountId,
|
|
|
+ EntAccountId: entAccountId,
|
|
|
+ PositionType: positionType,
|
|
|
+ PositionId: positionId,
|
|
|
+ MgoUserId: in.MgoUserId,
|
|
|
+ }
|
|
|
+ userPowers := userInfoRpc.GetUserPowers()
|
|
|
+
|
|
|
for _, v := range strings.Split(entity.ConfigJson.CommonlyIds, ",") {
|
|
|
+ // p562 我的订阅判断用户身份
|
|
|
+ if userPowers != nil {
|
|
|
+ if v == "163" { // 我的订阅(大会员)
|
|
|
+ if userPowers.Member.Status <= 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ } else if v == "165" { // 我的订阅(超级订阅)
|
|
|
+ if userPowers.Vip.Status <= 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ } else if v == "55" { // 我的订阅(商机管理)新版
|
|
|
+ if userPowers.Entniche.Status <= 0 || userPowers.Entniche.IsNew <= 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ } else if v == "515" { // 我的订阅(商机管理)老版
|
|
|
+ if userPowers.Entniche.Status <= 0 || userPowers.Entniche.IsNew > 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ } else if v == "167" { // 我的订阅
|
|
|
+ if userPowers.Vip.Status > 0 || userPowers.Member.Status > 0 || userPowers.Entniche.Status > 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
ids = append(ids, encrypt.SE.EncodeString(v))
|
|
|
}
|
|
|
in.MenuIds = strings.Join(ids, ",")
|