Ver Fonte

Merge branch 'feature/v1.2.22_ws' of BaseService/userCenter into feature/v1.2.22

wangshan há 1 ano atrás
pai
commit
20b88aa20e
1 ficheiros alterados com 11 adições e 8 exclusões
  1. 11 8
      entity/user.go

+ 11 - 8
entity/user.go

@@ -99,6 +99,14 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			if member.Status > 0 {
 				UserPowerMap["0"] = int(member.Status)
 				UserPowerMap[strconv.Itoa(50+int(member.Status))] = 1
+				//此处 如果 member.Status >7,和 下面58 会有冲突
+				//人员行为统计菜单-1、购买大会员且创建了企业的管理员;2、新版商机管理管理员;3、商机管理服务管理员
+				UserPowerMap["50"] = 1 //
+				if entInfo.EntRoleId == 1 {
+					UserPowerMap["58"] = 1 //企业管理员
+				} else if entInfo.EntRoleId == 2 {
+					UserPowerMap["59"] = 1 // 部门管理员
+				}
 			}
 			//大会员用户购买的服务 也有可能是非大会员用户 购买这些服务
 			if member.MemberPowerList != nil && len(member.MemberPowerList) > 0 {
@@ -127,9 +135,11 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 		if m.EntId > 0 {
 			UserPowerMap["702"] = 1
 			//机构中心  由企业 且 是企业版
+			//m.PositionType 肯定大于 0;  702 和 901 是同样的权限。
 			if m.PositionType > 0 {
 				UserPowerMap["901"] = 1
 			}
+			//P386
 			switch entInfo.EntRoleId {
 			case 1: //企业管理员
 				UserPowerMap["902"] = 1
@@ -189,6 +199,7 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 				//新免费用户
 				UserPowerMap["301"] = MC.If(free.IsUpgrade, 1, 0).(int)
 			}
+			//P386
 			switch entInfo.EntRoleId {
 			case 1: //企业管理员
 				UserPowerMap["302"] = 1
@@ -202,14 +213,6 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			UserPowerMap["400"] = 1
 		}
 		//人员行为统计菜单-1、购买大会员且创建了企业的管理员;2、新版商机管理管理员;3、商机管理服务管理员
-		if member.Status > 0 {
-			UserPowerMap["50"] = 1 //
-			if entInfo.EntRoleId == 1 {
-				UserPowerMap["58"] = 1 //企业管理员
-			} else if entInfo.EntRoleId == 2 {
-				UserPowerMap["59"] = 1 // 部门管理员
-			}
-		}
 		//必须是企业管理员-&-购买了企业级应用服务
 		//企业级服务 权限管理(只有企业管理员有权限)
 		entService := entInfo.BuyMember > 0 || entInfo.BuyVip > 0