wangshan 3 ani în urmă
părinte
comite
afb8ec5f40

+ 6 - 3
src/jfw/modules/publicapply/src/userbase/entity/entity.go

@@ -38,7 +38,7 @@ func (this *UserInfo) SaveNameByUserId() bool {
 	var namesarr = []string{}
 	if this.Names != "" {
 		for _, v := range strings.Split(this.Names, ",") {
-			if IsPower(v, this.UserId) {
+			if !ChargeMap[v] || IsPower(v, this.UserId) {
 				namesarr = append(namesarr, v)
 			}
 		}
@@ -101,10 +101,13 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 	return fns
 }
 
+var ChargeMap = map[string]bool{}
+
 //获取所有用户可用功能
 func (this *UserInfo) AllNames() (fns []*FuncNames) {
 	for _, v := range BaseFuncInfo.CommonFunctions {
-		if IsPower(v.Name, this.UserId) {
+		ChargeMap[v.Name] = v.Charge
+		if !v.Charge || IsPower(v.Name, this.UserId) {
 			fns = append(fns, &FuncNames{
 				Name: v.Name,
 				Url:  thisByPlat(this.Platform, "url", &v),
@@ -149,7 +152,7 @@ func IsPower(name, userId string) (b bool) {
 	if BigPower.Status > 0 {
 		switch name {
 		case "企业情报监控":
-			b = true || BigPower.PowerMap[4] || BigPower.PowerMap[12] || BigPower.PowerMap[13]
+			b = BigPower.PowerMap[4] || BigPower.PowerMap[12] || BigPower.PowerMap[13]
 		case "潜在客户挖掘", "客户关注":
 			b = BigPower.PowerMap[7]
 		case "潜在竞争对手/合作伙伴挖掘":