Browse Source

fix:画像留资兼容

duxin 1 year ago
parent
commit
abc2e21471
1 changed files with 14 additions and 1 deletions
  1. 14 1
      src/service/action/info.go

+ 14 - 1
src/service/action/info.go

@@ -47,6 +47,7 @@ var (
 	phoneReg               = regexp.MustCompile("^[1][0-9][0-9]{9}$")
 	emailReg               = regexp.MustCompile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$")
 	AppNewUserRegistration = "app_New_User_retain_%s"
+	sc                     = []string{"ent_portrait_bidInfoDesc", "buyer_portrait_bidInfoDesc", "buyer_portrait_cooperative_ent_capital", "buyer_portrait_cooperative_ent_age", "buyer_portrait_cooperative_ent_register_area"}
 )
 
 func init() {
@@ -305,7 +306,7 @@ func (i *Info) CollectInfo() {
 			}
 			//免费用户留资 获取采购单位画像、企业画像、附件下载的权益(一次)
 			//判断免费用户留资,无需在更改留资情况 已留资将不在留资
-			if strings.HasSuffix(source, "_freeuser") && len(strings.Split(source, "_")) > 2 && Free_users(source, userId) {
+			if PortraitExperience(source) && len(strings.Split(source, "_")) > 2 && Free_users(source, userId) {
 				FreeuserManage(source, userId)
 			}
 			//P36
@@ -346,6 +347,18 @@ func (i *Info) CollectInfo() {
 	i.ServeJson(r)
 }
 
+func PortraitExperience(source string) bool {
+	if strings.HasSuffix(source, "_freeuser") {
+		return true
+	}
+	for _, s := range sc {
+		if s == source {
+			return true
+		}
+	}
+	return false
+}
+
 // 回显数据
 func (i *Info) EchoInfo() {
 	r := func() Result {