Browse Source

Merge branch 'feature/v4.7.55' of ssh://192.168.3.207:10022/qmx/jy into feature/v4.7.55

wangchuanjin 2 years ago
parent
commit
08de0e1343
58 changed files with 3204 additions and 631 deletions
  1. 19 7
      src/jfw/active/21yearEndReport.go
  2. 63 44
      src/jfw/filter/phonefilter.go
  3. 8 3
      src/jfw/front/front.go
  4. 3 2
      src/jfw/front/org_structure.go
  5. 3 2
      src/jfw/jyutil/jyutil.go
  6. 22 2
      src/jfw/modules/app/src/app/active/21yearEndReport.go
  7. 56 31
      src/jfw/modules/app/src/app/filter/phonefilter.go
  8. 1 1
      src/jfw/modules/app/src/web/staticres/jyapp/me/js/phone_bind.js
  9. 16 1
      src/jfw/modules/app/src/web/templates/frontRouter/userMerge/free/confirm.html
  10. 8 2
      src/jfw/modules/app/src/web/templates/frontRouter/userMerge/free/index.html
  11. 149 0
      src/jfw/modules/app/src/web/templates/frontRouter/verify/free/index.html
  12. 4 0
      src/jfw/modules/bigmember/src/config.yaml
  13. 9 0
      src/jfw/modules/bigmember/src/config/config.go
  14. 2 2
      src/jfw/modules/bigmember/src/entity/followEnterprise.go
  15. 3 3
      src/jfw/modules/bigmember/src/entity/followProject.go
  16. 9 6
      src/jfw/modules/bigmember/src/entity/portrait.go
  17. 5 3
      src/jfw/modules/bigmember/src/entity/trial.go
  18. 7 2
      src/jfw/modules/bigmember/src/filter/sessionfilter.go
  19. 87 6
      src/jfw/modules/bigmember/src/go.mod
  20. 530 5
      src/jfw/modules/bigmember/src/go.sum
  21. 6 2
      src/jfw/modules/bigmember/src/service/analysis/decision.go
  22. 5 1
      src/jfw/modules/bigmember/src/service/analysis/forecastproject.go
  23. 16 6
      src/jfw/modules/bigmember/src/service/analysis/potential.go
  24. 9 4
      src/jfw/modules/bigmember/src/service/analysis/util.go
  25. 7 3
      src/jfw/modules/bigmember/src/service/bidfile/bidfile.go
  26. 35 11
      src/jfw/modules/bigmember/src/service/follow/enterprise.go
  27. 43 13
      src/jfw/modules/bigmember/src/service/follow/project.go
  28. 15 11
      src/jfw/modules/bigmember/src/service/follow/projectPdf.go
  29. 57 15
      src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go
  30. 50 12
      src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go
  31. 15 8
      src/jfw/modules/bigmember/src/service/push/push.go
  32. 15 6
      src/jfw/modules/bigmember/src/service/report/marketAnalysis.go
  33. 5 2
      src/jfw/modules/bigmember/src/service/trial/trial.go
  34. 178 134
      src/jfw/modules/bigmember/src/service/use/use.go
  35. 4 5
      src/jfw/modules/distribution/src/service/filter/phonefilter.go
  36. 19 61
      src/jfw/modules/publicapply/src/bidcollection/entity/entity.go
  37. 124 114
      src/jfw/modules/publicapply/src/bidcollection/service/service.go
  38. 4 0
      src/jfw/modules/publicapply/src/config.yaml
  39. 3 0
      src/jfw/modules/publicapply/src/config/config.go
  40. 88 3
      src/jfw/modules/publicapply/src/go.mod
  41. 538 3
      src/jfw/modules/publicapply/src/go.sum
  42. 17 57
      src/jfw/modules/publicapply/src/shareFission/service/service.go
  43. 4 4
      src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go
  44. 5 5
      src/jfw/modules/publicapply/src/subscribePush/entity/setting.go
  45. 5 6
      src/jfw/modules/publicapply/src/subscribePush/service/subscribe.go
  46. 3 0
      src/jfw/modules/subscribepay/src/a/init.go
  47. 79 0
      src/jfw/modules/subscribepay/src/service/exceptionVerification.go
  48. 27 21
      src/jfw/modules/subscribepay/src/service/phoneCollent.go
  49. 312 0
      src/web/staticres/common-module/account/js/verify.js
  50. 1 1
      src/web/staticres/common-module/share/js/invite-friends.js
  51. BIN
      src/web/staticres/commonFunctions/wm-team-reports.png
  52. BIN
      src/web/staticres/docs/aaaa.docx
  53. BIN
      src/web/staticres/docs/个人年终报告.docx
  54. 7 0
      src/web/staticres/frontRouter/pc/collection/css/index-pc.css
  55. 1 1
      src/web/templates/frontRouter/pc/brand/free/index.html
  56. 4 0
      src/web/templates/frontRouter/pc/userMerge/sess/bind.html
  57. 353 0
      src/web/templates/frontRouter/pc/userMerge/sess/verify.html
  58. 146 0
      src/web/templates/frontRouter/wx/verify/free/index.html

+ 19 - 7
src/jfw/active/21yearEndReport.go

@@ -5,15 +5,10 @@ import (
 	"jy/src/jfw/config"
 	"net/url"
 	"time"
-
 	"jy/src/jfw/jyutil"
-
 	"app.yhyue.com/moapp/jypkg/public"
-
 	qutil "app.yhyue.com/moapp/jybase/common"
-
 	"app.yhyue.com/moapp/jybase/redis"
-
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"go.mongodb.org/mongo-driver/bson"
@@ -48,10 +43,27 @@ func init() {
 //YearEndReport 21年,年终报告
 type YearEndReport struct {
 	*xweb.Action
-	yearEndReportPage   xweb.Mapper `xweb:"/active/yearEndReport"`       //21年终报告wx页面
-	yearEndReportResult xweb.Mapper `xweb:"/active/yearEndReportResult"` //21年终报告wx结果页面
+	yearEndReportPage     xweb.Mapper `xweb:"/active/yearEndReport"`       //21年终报告wx页面
+	yearEndReportResult   xweb.Mapper `xweb:"/active/yearEndReportResult"` //21年终报告wx结果页面
+	yearEndReportPageBy22 xweb.Mapper `xweb:"/active/yearEndReportBy22"`   //22年终报告wx页面
+}
+
+//
+func (this *YearEndReport) YearEndReportPageBy22() error {
+	phone := qutil.ObjToString(this.Session().Get("phone"))
+	//session 中没有手机号 直接跳首页
+	if phone == "" {
+		return this.Redirect("/jylab/mainSearch")
+	}
+	//有手机号 查询企业报告是否有权限
+	if count := public.Mysql.CountBySql(`SELECT COUNT(id) FROM  entniche_user WHERE phone = ?`, phone); count > 0 {
+		return this.Redirect("/succbi/nzbg/app/nzbg.app/nzbg_entrance_app_td.spg")
+	}
+	//企业年终报告无权限--添加企业
+	return this.Redirect("/page_entniche_new/page/loading.html?source=report")
 }
 
+//
 func (this *YearEndReport) YearEndReportResult() error {
 	return this.Render("/active/yearEndReport/result.html")
 }

+ 63 - 44
src/jfw/filter/phonefilter.go

@@ -45,26 +45,33 @@ func init() {
 }
 
 func (l *phoneFilter) Do() bool {
-	if !initflag {
-		return true
-	}
-	if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); !flag {
-		return true
-	}
-	if l.R.Method == "POST" {
-		return true
-	}
-	href := "/swordfish/frontPage/userMerge/sess/bind" //pc
-	for _, v := range bindurl {
-		if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
+	userId, _ := l.GetSession["userId"].(string)
+	// 请求过滤
+	pass := func() bool {
+		if !initflag || l.R.Method == "POST" || userId == "" {
+			return true
+		}
+		if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); !flag {
 			return true
 		}
+		for _, v := range bindurl {
+			if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
+				return true
+			}
+		}
+		return false
+	}()
+	if pass {
+		return true
 	}
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+
+	//是否需要跳转绑定手机号
+	needBindPhone := func() bool {
+		//绑定手机号判断
 		if phone := l.GetSession["phone"]; phone != nil && phone != "" {
-			return true
+			return false
 		}
-		if person, sessionVal := jyutil.GetSessionVal(map[string]interface{}{"_id": mongodb.StringTOBsonId(qu.ObjToString(uid))}); len(sessionVal) > 0 && person != nil {
+		if person, sessionVal := jyutil.GetSessionVal(map[string]interface{}{"_id": mongodb.StringTOBsonId(qu.ObjToString(userId))}); len(sessionVal) > 0 && person != nil {
 			s_phone := qu.ObjToString((*person)["s_phone"])
 			if s_phone == "" {
 				s_phone = qu.ObjToString((*person)["s_m_phone"])
@@ -72,58 +79,70 @@ func (l *phoneFilter) Do() bool {
 			if s_phone != "" {
 				sessionVal["phone"] = s_phone
 				l.Session.SetMultiple(sessionVal)
-				return true
-			}
-			if userAgent := l.R.UserAgent(); mobileReg.MatchString(userAgent) {
-				href = "/front/account/phone/bind?mode=mergeBind" //wx
-				redirectTo := l.R.URL.String()
-				href += "&redirectTo=" + encodeURIComponent(redirectTo) //加密 前端用于返回
+				return false
 			}
 			regtime := qu.Int64All((*person)["l_registedate"])
 			reg := time.Unix(regtime, 0)
 			//新用户时间
 			accountMergeOnline, _ := config.Sysconfig["accountMergeOnline"].(string)
 			onLineTime, _ := time.ParseInLocation(Date_Full_Layout, accountMergeOnline, time.Local)
-			if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
-				return true
-			}
 			//取关用户
 			if i_ispush := qu.IntAll((*person)["i_ispush"]); i_ispush == 0 {
-				return true
+				return false
 			}
 			if onLineTime.After(reg) { //老用户
-				if !urls.MatchString(l.R.URL.Path) {
-					return true
-				}
 				dbname, _ := config.Sysconfig["bindPopRedis"].(string)
-				bindPopNum := redis.GetInt(dbname, fmt.Sprintf("bindPop_%s", uid))
-				key := fmt.Sprintf("bindPop_%s", uid)
-				if redis.Incr(dbname, key) == 1 {
-					_ = redis.SetExpire(dbname, key, GetExpire())
-				}
-				if bindPopNum != (qu.IntAll(config.Sysconfig["firstBindPop"]))-1 &&
-					bindPopNum < (qu.IntAll(config.Sysconfig["maxBindPop"]))-1 {
+				key := fmt.Sprintf("bindPop_new_%s", userId)
+				if redis.GetInt(dbname, key) >= qu.IntAll(config.Sysconfig["maxBindPop"]) {
 					return true
 				}
+				if urls.MatchString(l.R.URL.Path) {
+					bindPopNum := redis.Incr(dbname, key)
+					if bindPopNum == qu.Int64All(config.Sysconfig["firstBindPop"]) ||
+						bindPopNum > qu.Int64All(config.Sysconfig["maxBindPop"]) {
+						return true
+					}
+				}
+				return false
 			}
 			//设置cookie 前端跳转
 			SetCookie(l.R.URL.String(), int(time.Hour*24/time.Second), l.W)
-		} else {
 			return true
 		}
+		return false
+	}()
+
+	var href string
+	// 跳转绑定手机号页面
+	if needBindPhone {
+		if mobileReg.MatchString(l.R.UserAgent()) {
+			href = "/front/account/phone/bind?mode=mergeBind&redirectTo=" + encodeURIComponent(l.R.URL.String())
+		} else {
+			href = "/swordfish/frontPage/userMerge/sess/bind"
+		}
 	} else {
-		return true
+		// 是否需要验证手机号
+		if exists, _ := redis.Exists("newother", fmt.Sprintf("abnormal_trigger_%s", userId)); exists {
+			if mobileReg.MatchString(l.R.UserAgent()) {
+				href = "/weixin/frontPage/verify/free/index?redirectTo=" + encodeURIComponent(l.R.URL.String())
+			} else {
+				href = "/swordfish/frontPage/userMerge/sess/verify?redirectTo=" + encodeURIComponent(l.R.URL.String())
+			}
+		}
 	}
-	http.Redirect(l.W, l.R, href, 302)
-	return false
+	if href != "" {
+		http.Redirect(l.W, l.R, href, 302)
+		return false
+	}
+	return true
 }
 
 //获取当天结束时间 单位秒
-func GetExpire() int {
-	t, _ := time.ParseInLocation(Date_Short_Layout, time.Now().AddDate(0, 0, 1).Format(Date_Short_Layout), time.Local)
-	t2, _ := time.ParseInLocation(Date_Full_Layout, time.Now().Format(Date_Full_Layout), time.Local)
-	return int(t.Unix() - t2.Unix())
-}
+//func GetExpire() int {
+//	t, _ := time.ParseInLocation(qu.Date_Short_Layout, time.Now().AddDate(0, 0, 1).Format(qu.Date_Short_Layout), time.Local)
+//	t2, _ := time.ParseInLocation(qu.Date_Full_Layout, time.Now().Format(qu.Date_Full_Layout), time.Local)
+//	return int(t.Unix() - t2.Unix())
+//}
 
 //文章三级页跳转设置cookie
 func SetCookie(value string, timeout int, w http.ResponseWriter) {

+ 8 - 3
src/jfw/front/front.go

@@ -1595,12 +1595,17 @@ func NeedBind(uid string) bool {
 			//新用户时间
 			accountMergeOnline, _ := config.Sysconfig["accountMergeOnline"].(string)
 			onLineTime, _ := time.ParseInLocation(Date_Full_Layout, accountMergeOnline, time.Local)
-			if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
-				return false
-			}
+			//if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
+			//	return false
+			//}
 			if onLineTime.Before(reg) { //新用户
 				return true
 			}
+			dbname, _ := config.Sysconfig["bindPopRedis"].(string)
+			key := fmt.Sprintf("bindPop_new_%s", uid)
+			if redis.GetInt(dbname, key) >= util.IntAll(config.Sysconfig["maxBindPop"]) {
+				return true
+			}
 		}
 	}
 	return false

+ 3 - 2
src/jfw/front/org_structure.go

@@ -68,10 +68,11 @@ func (this *OrgStructure) InvitationPage() error {
 	depcname := this.GetString("depcname")
 	registered := "0"                                        //是否是剑鱼用户:0:未关注; 1:已关注
 	entUserId_str := encrypt.SE.Decode4HexByCheck(entUserId) //解密
+	source := this.GetString("source")
 	entUserId_sess := this.GetSession("entUserId")
-	OrgUrl := util.ObjToString(config.Sysconfig["wxOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+	OrgUrl := util.ObjToString(config.Sysconfig["wxOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname + "&source=" + source
 	if !mobileReg.MatchString(client) {
-		OrgUrl = util.ObjToString(config.Sysconfig["pcOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname
+		OrgUrl = util.ObjToString(config.Sysconfig["pcOrgUrl"]) + "?entUserId=" + entUserId + "&depId=" + depId + "&entId=" + entId + "&depcname=" + depcname + "&source=" + source
 	} else if entUserId_sess == nil || util.ObjToString(entUserId_sess) != entUserId_str {
 		userId := util.ObjToString(this.Session().Get("userId"))
 		openId := util.ObjToString(this.Session().Get("s_m_openid"))

+ 3 - 2
src/jfw/jyutil/jyutil.go

@@ -85,7 +85,7 @@ func Getopenid(code string) (openid string) {
 
 //
 func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[string]interface{}) {
-	person, ok := public.MQFW.FindOneByField("user", q, `{"_id":1,"i_shareknow":1,"s_m_openid":1,"s_nickname":1,"s_headimage":1,"s_headimageurl":1,"s_phone":1,"s_m_phone":1,"l_registedate":1,"b_merge_remind":1,"i_ispush":1,"i_unlimited":1,"s_jyname":1,"base_user_id":1}`)
+	person, ok := public.MQFW.FindOneByField("user", q, `{"_id":1,"i_shareknow":1,"s_m_openid":1,"s_nickname":1,"s_headimage":1,"s_headimageurl":1,"s_phone":1,"s_m_phone":1,"l_registedate":1,"i_ispush":1,"i_unlimited":1,"s_jyname":1,"base_user_id":1}`)
 	sessionVal := make(map[string]interface{})
 	if !ok || person == nil || len(*person) == 0 {
 		return nil, sessionVal
@@ -119,7 +119,7 @@ func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[strin
 	}
 	if phone != "" {
 		//企业信息存session
-		sql := `SELECT a.id,a.name,a.startdate,a.enddate,a.quota,c.id as dept_id,b.id as user_id from entniche_info a 
+		sql := `SELECT a.id,a.name,a.startdate,a.enddate,a.quota,c.id as dept_id,b.id as user_id,b.name as user_name from entniche_info a 
 			INNER JOIN entniche_user b on (b.phone=? and a.id=b.ent_id) 
 			INNER JOIN entniche_department c on (c.pid=0 and a.id=c.ent_id) 
 			LEFT JOIN entniche_user_role d on (d.role_id=? and b.id=d.user_id)  
@@ -133,6 +133,7 @@ func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[strin
 				sessionVal["entId"] = util.IntAll(v["id"])
 				sessionVal["entName"] = util.ObjToString(v["name"])
 				sessionVal["entUserId"] = util.IntAll(v["user_id"])
+				sessionVal["entUserName"] = util.ObjToString(v["user_name"])
 				sessionVal["frameworkEntId"] = util.IntAll(v["id"])
 				sessionVal["frameworkEntName"] = util.ObjToString(v["name"])
 				break

+ 22 - 2
src/jfw/modules/app/src/app/active/21yearEndReport.go

@@ -3,7 +3,10 @@ package active
 import (
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/public"
 	"time"
+
+	"github.com/go-xweb/xweb"
 )
 
 const (
@@ -34,10 +37,27 @@ func init() {
 //YearEndReport 21年,年终报告
 type YearEndReport struct {
 	*xweb.Action
-	yearEndReportPage   xweb.Mapper `xweb:"/jyapp/active/yearEndReport"`       //21年终报告app页面
-	yearEndReportResult xweb.Mapper `xweb:"/jyapp/active/yearEndReportResult"` //21年终报告app结果页面
+	yearEndReportPage     xweb.Mapper `xweb:"/jyapp/active/yearEndReport"`       //21年终报告app页面
+	yearEndReportResult   xweb.Mapper `xweb:"/jyapp/active/yearEndReportResult"` //21年终报告app结果页面
+	yearEndReportPageBy22 xweb.Mapper `xweb:"/jyapp/active/yearEndReportBy22"`   //22年终报告app页面-团队报告
+}
+
+//22年终报告app页面-团队报告
+func (this *YearEndReport) YearEndReportPageBy22() error {
+	phone := qutil.ObjToString(this.Session().Get("phone"))
+	//session 中没有手机号 直接跳首页
+	if phone == "" {
+		return this.Redirect("/jyapp/jylab/mainSearch")
+	}
+	//有手机号 查询企业报告是否有权限
+	if count := public.Mysql.CountBySql(`SELECT COUNT(id) FROM  entniche_user WHERE phone = ?`, phone); count > 0 {
+		return this.Redirect("/succbi/nzbg/app/nzbg.app/nzbg_entrance_app_td.spg")
+	}
+	//企业年终报告无权限--添加企业
+	return this.Redirect("/page_entniche_new/page/loading.html?source=report")
 }
 
+//
 func (this *YearEndReport) YearEndReportResult() error {
 	return this.Render("/active/yearEndReport/result.html")
 }

+ 56 - 31
src/jfw/modules/app/src/app/filter/phonefilter.go

@@ -42,63 +42,81 @@ func init() {
 }
 
 func (l *phoneFilter) Do() bool {
-	if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); !flag {
-		return true
-	}
-	if l.R.Method == "POST" || !initflag {
-		return true
-	}
-	href := "/jyapp/account/phone/bind?mode=mergeBind"
-	for _, v := range bindurl {
-		if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "squeeze") {
+
+	userId, _ := l.GetSession["userId"].(string)
+	// 请求过滤
+	pass := func() bool {
+		if !initflag || l.R.Method == "POST" || userId == "" {
+			return true
+		}
+		if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); !flag {
 			return true
 		}
+		for _, v := range bindurl {
+			if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "squeeze") {
+				return true
+			}
+		}
+		return false
+	}()
+	if pass {
+		return true
 	}
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	isNewUser := false
+	//是否需要跳转绑定手机号
+	needBindPhone := func() bool {
 		if phone := l.GetSession["phone"]; phone != nil && phone != "" {
-			return true
+			return false
 		}
-		if person, ok := public.MQFW.FindById("user", mongodb.BsonIdToSId(qu.ObjToString(uid)), `{"s_phone":1,"s_m_phone":1,"l_registedate":1,"b_merge_remind":1}`); person != nil && ok {
+		if person, ok := public.MQFW.FindById("user", mongodb.BsonIdToSId(qu.ObjToString(userId)), `{"s_phone":1,"s_m_phone":1,"l_registedate":1}`); person != nil && ok {
 			s_phone := qu.ObjToString((*person)["s_phone"])
 			if s_phone == "" {
 				s_phone = qu.ObjToString((*person)["s_m_phone"])
 			}
 			if s_phone != "" {
 				l.Session.Set("phone", s_phone)
-				return true
+				return false
 			}
 			regtime := qu.Int64All((*person)["l_registedate"])
 			reg := time.Unix(regtime, 0)
 			//新用户时间
 			accountMergeOnline, _ := config.Sysconfig["accountMergeOnline"].(string)
 			onLineTime, _ := time.ParseInLocation(Date_Full_Layout, accountMergeOnline, time.Local)
-			if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
-				return true
-			}
 			if onLineTime.After(reg) { //老用户
-				if !articleUrl.MatchString(l.R.URL.Path) {
-					return true
-				}
 				dbname, _ := config.Sysconfig["bindPopRedis"].(string)
-				key := fmt.Sprintf("bindPop_%s", uid)
-				bindPopNum := redis.GetInt(dbname, key)
-				if redis.Incr(dbname, key) == 1 {
-					_ = redis.SetExpire(dbname, key, GetExpire())
-				}
-				if bindPopNum != (qu.IntAll(config.Sysconfig["firstBindPop"]))-1 &&
-					bindPopNum < (qu.IntAll(config.Sysconfig["maxBindPop"]))-1 {
+				key := fmt.Sprintf("bindPop_new_%s", userId)
+				if redis.GetInt(dbname, key) >= qu.IntAll(config.Sysconfig["maxBindPop"]) {
 					return true
 				}
-				//设置cookie 前端跳转
-				SetCookie(l.R.URL.String(), int(time.Hour*24/time.Second), l.W)
+				if articleUrl.MatchString(l.R.URL.Path) {
+					bindPopNum := redis.Incr(dbname, key)
+					if bindPopNum == qu.Int64All(config.Sysconfig["firstBindPop"]) ||
+						bindPopNum > qu.Int64All(config.Sysconfig["maxBindPop"]) {
+						return true
+					}
+				}
+				return false
 			} else {
-				//新用户
-				href += "&act=logout"
+				isNewUser = true
 			}
+			//设置cookie 前端跳转
+			SetCookie(l.R.URL.String(), int(time.Hour*24/time.Second), l.W)
+			return true
+		}
+		return false
+	}()
+	var href string
+	if needBindPhone {
+		href = "/jyapp/account/phone/bind?mode=mergeBind"
+		if isNewUser {
+			href += "&act=logout"
 		}
 	} else {
-		return true
+		if exists, _ := redis.Exists("newother", fmt.Sprintf("abnormal_trigger_%s", userId)); exists {
+			href = "/jyapp/frontPage/verify/free/index?mode=phoneCheck"
+		}
 	}
+<<<<<<< HEAD
 	http.Redirect(l.W, l.R, href, 302)
 	return false
 }
@@ -108,6 +126,13 @@ func GetExpire() int {
 	t, _ := time.ParseInLocation(Date_Short_Layout, time.Now().AddDate(0, 0, 1).Format(Date_Short_Layout), time.Local)
 	t2, _ := time.ParseInLocation(Date_Full_Layout, time.Now().Format(Date_Full_Layout), time.Local)
 	return int(t.Unix() - t2.Unix())
+=======
+	if href != "" {
+		http.Redirect(l.W, l.R, href, 302)
+		return false
+	}
+	return true
+>>>>>>> master
 }
 
 //文章三级页跳转设置cookie

+ 1 - 1
src/jfw/modules/app/src/web/staticres/jyapp/me/js/phone_bind.js

@@ -386,7 +386,7 @@ var vm = new Vue({
                             _this.afterSetPhoneSuccess()
                         }
                     } else if (state == 2) {
-                        location.replace('/jyapp/frontPage/userMerge/free/index?token=' + _this.token)
+                        location.replace('/jyapp/frontPage/userMerge/free/index?from=bindPhone&token=' + _this.token)
                     }
                 })
             } else {

+ 16 - 1
src/jfw/modules/app/src/web/templates/frontRouter/userMerge/free/confirm.html

@@ -96,6 +96,8 @@
             data: {
                 neverRemind: false, // 不再提醒
                 checkedColor: '#2CB7CA',
+                // from默认为'', 值为bindPhone时表示从手机号绑定页面/jyapp/account/phone/bind?mode=mergeBind过来的
+                from: '',
                 token: '',
                 userName:{
                     wx:'',
@@ -118,6 +120,10 @@
             },
             created () {
                 this.token = utils.getParam('token')
+                var from = utils.getParam('from')
+                if (from) {
+                    this.from = from
+                }
                 this.getInfo()
             },
             methods: {
@@ -237,7 +243,16 @@
                     this.confirmRequest(this.successCallback)
                 },
                 successCallback: function () {
-                    history.go(-2)
+                    if (this.from === 'bindPhone') {
+                        // 清空缓存,并回首页
+                        sessionStorage.clear()
+                        JyObj.backUrl('H')
+                        JyObj.refreshAppointTab('subscribe', 1)
+                        JyObj.refreshAppointTab('box', 1)
+                        JyObj.refreshAppointTab('me', 1)
+                    } else {
+                        history.go(-2)
+                    }
                 },
                 noticeHandle: function(){
                     var html = '<p>合并须知:</p><p>1.账号合并为手机号和微信号进行合并绑定,两个账号内功能、剑鱼币、优惠券等均可合并。</p><p>2.账号信息将根据您选择的账号进行保留,未被选择的账号信息将被舍弃,请慎重选择。</p><p>3.账号合并后,您使用微信或手机号进行登录,将看到并使用相同的功能设置,共同使用账号内的功能、剑鱼币、优惠券等。</p><p>4.如您选择确认合并,则默认为您已阅读并同意此须知。</p>'

+ 8 - 2
src/jfw/modules/app/src/web/templates/frontRouter/userMerge/free/index.html

@@ -68,6 +68,8 @@
             delimiters: ['${', '}'],
             el: '#merge-prompt',
             data: {
+                // from默认为'', 值为bindPhone时表示从手机号绑定页面/jyapp/account/phone/bind?mode=mergeBind过来的
+                from: '',
                 token: '',
                 userName:{
                     wx:'',
@@ -114,6 +116,10 @@
             },
             created () {
                 this.token = utils.getParam('token')
+                var from = utils.getParam('from')
+                if (from) {
+                    this.from = from
+                }
                 this.getInfo()
             },
             methods: {
@@ -176,9 +182,9 @@
                     }
                 },
                 nextStep: function () {
-                    var url = './confirm'
+                    var url = `./confirm?from=${this.from}`
                     if (this.token) {
-                        url = './confirm?token=' + this.token
+                        url = `./confirm?token=${this.token}&from=${this.from}`
                     }
                     location.href = url
                 },

+ 149 - 0
src/jfw/modules/app/src/web/templates/frontRouter/verify/free/index.html

@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<head>
+    <!--引入公共资源头部-->
+    {{include "/big-member/meta.html"}}
+    <title>账号异常验证</title>
+
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <style>
+        .auth-tip{
+            padding: .48rem 0 .36rem;
+        }
+        .auth-tip p{
+            color: #9B9CA3;
+            font-size: .28rem;
+            line-height: .4rem;
+            text-align: center;
+        }
+        .auth-phone{
+            padding-bottom: .48rem;
+            color: #5F5E64;
+            font-size: .4rem;
+            line-height: .6rem;
+            text-align: center;
+        }
+        .picture-code{
+            width: 90px;
+            height: 30px;
+            background: #F5F6F7;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+        .van-field__label{
+            font-size: .3rem;
+        }
+        .van-field__control{
+            font-size: .32rem;
+        }
+        .van-field--error .van-field__control, .van-field--error .van-field__control::placeholder{
+            color: #171826;
+        }
+        .send_btn{
+            background-color: transparent;
+            color: #2ABED1;
+            border: 0;
+            font-size: .28rem;
+            height: unset;
+        }
+        .send_btn:disabled{
+            color: #9B9CA3;
+        }
+        .picture-cell{
+            padding: .28rem .32rem;
+        }
+        .code-cell{
+            padding: .32rem;
+        }
+        .unbind-dialog .van-dialog__header{
+            font-weight: bold;
+            font-size: .36rem;
+        }
+        .unbind-dialog .van-dialog__message{
+            padding: .16rem 0 .44rem;
+            color: #5F5E64;
+            font-size: .3rem;
+        }
+        .unbind-dialog .van-button{
+            font-size: .36rem;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="j-container"  id="auth" v-cloak>
+        <div class="j-header jy-app-header" style="background: #fff;">
+          <span class="header-left" @click="goBack()">
+              <span class="icon-back j-icon base-icon" style="color: #5F5E64;"></span>
+          </span>
+          <span class="header-title" style="color: #171826;">账号异常验证</span>
+          <span class="header-right"></span>
+        </div>
+        <div class="j-main">
+            <div class="auth-tip">
+              <p>您好,系统识别到您的账号异常,</p>
+              <p>请您对登录手机号进行验证。</p>
+            </div>
+            <div class="auth-phone">${phoneFn(info.phone)}</div>
+            <div class="auth-form">
+                <van-form ref="phoneForm" @submit="submitForm">
+                    <van-field
+                        v-if="cur.showCaptcha"
+                        center
+                        class="picture-cell"
+                        v-model.trim="pictureCode"
+                        type="number"
+                        name="picture"
+                        placeholder="图形验证码"
+                        :rules="pictureRules"
+                        @input="inputPicture(pictureCode)"
+                    >
+                        <template #button>
+                            <div class="picture-code">
+                                <img v-if="cur.imgSrc" :src="'data:image/png;base64,' + cur.imgSrc" alt="图形验证码" width="90" height="30" @click="refreshPicture" key="picCode" />
+                                <van-loading size="24" v-else key="picCode"></van-loading>
+                            </div>
+                        </template>
+                    </van-field>
+                    <van-field
+                        center
+                        class="code-cell"
+                        v-model.trim="msgCode"
+                        type="number"
+                        name="code"
+                        label="验证码"
+                        placeholder="请输入验证码"
+                        :rules="regCodeRules"
+                        @input="inputCode(msgCode)"
+                    >
+                        <template #button>
+                            <van-button native-type="button" v-show="sendCodeBtn" class="send_btn" slot="button"  size="small" @click="sendMobileCode" type="button">发送验证码</van-button>
+                            <van-button native-type="button" v-show="!sendCodeBtn" class="send_btn gray" slot="button" size="small" disabled type="button">重新发送(${countdown}s)</van-button>
+                        </template>
+                    </van-field>
+                    <div class="j-footer j-button-group" style="background-color: transparent;padding: .64rem .32rem;">
+                        <button class="j-button-confirm" native-type="submit" :disabled="!btnStatus">立即验证</button>
+                    </div>
+                </van-form>
+            </div>
+        </div>
+
+    </div>
+
+    <!--S-当前页面的资源-->
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+    <!--E-当前页面的资源-->
+    {{include "/big-member/commonjs.html"}}
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/account/js/verify.js?v={{Msg "seo" "version"}}'></script>
+    {{include "/common/baiducc.html"}}
+
+</body>
+
+</html>

+ 4 - 0
src/jfw/modules/bigmember/src/config.yaml

@@ -0,0 +1,4 @@
+Etcd:
+  Hosts:
+    - 127.0.0.1:2379
+  Key: powercheck.rpc

+ 9 - 0
src/jfw/modules/bigmember/src/config/config.go

@@ -4,6 +4,8 @@ import (
 	qutil "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mail"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/middleGround"
+	"github.com/zeromicro/go-zero/core/conf"
+	"github.com/zeromicro/go-zero/rest"
 )
 
 type config struct {
@@ -73,12 +75,19 @@ type followConfig struct {
 }
 
 var Config *config
+var EtcConfig *etcConfig
 var GmailAuth []*mail.GmailAuth
 
+type etcConfig struct {
+	rest.RestConf
+}
+
 func init() {
+	conf.MustLoad("config.yam", &EtcConfig)
 	//程序配置文件
 	qutil.ReadConfig(&Config)
 	qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
+	conf.MustLoad("config.yam", &EtcConfig)
 	for _, v := range Config.Mail {
 		mail := &mail.GmailAuth{
 			SmtpHost: v.Addr,

+ 2 - 2
src/jfw/modules/bigmember/src/entity/followEnterprise.go

@@ -27,11 +27,11 @@ type EntFollow struct {
 }
 
 // CreateEntFollowManager 企业关注相关方法
-func CreateEntFollowManager(userid string, pageFlag ...string) (*EntFollow, error) {
+func CreateEntFollowManager(userid string, baseUserId, accountId, entId int64, pageFlag ...string) (*EntFollow, error) {
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 
 	defaultPageFlag := "entFollow"
 	if len(pageFlag) > 0 {

+ 3 - 3
src/jfw/modules/bigmember/src/entity/followProject.go

@@ -6,13 +6,13 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
 	"sort"
 	"strconv"
 	"strings"
 	"sync"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 
 	qutil "app.yhyue.com/moapp/jybase/common"
 	elastic "app.yhyue.com/moapp/jybase/esv1"
@@ -22,11 +22,11 @@ import (
 )
 
 // CreateProjectFollowManager 项目关注相关方法
-func CreateProjectFollowManager(userid string, mustBuy ...bool) (*ProjectFollow, error) {
+func CreateProjectFollowManager(userid string, baseUserId, accountId, entId int64, mustBuy ...bool) (*ProjectFollow, error) {
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 
 	isBuy := bigMsg.CheckBigVipBackPower("followProject")
 	if len(mustBuy) > 0 && !isBuy {

+ 9 - 6
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -3,6 +3,7 @@ package entity
 import (
 	"errors"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"log"
 	"strings"
@@ -23,11 +24,11 @@ const (
 )
 
 // CreatePortraitManager 大会员
-func CreatePortraitManager(userid string, pageFlag string) (*Portrait, bool, error, bool) {
+func CreatePortraitManager(userid string, baseUserId, accountId, entId int64, pageFlag string) (*Portrait, bool, error, bool) {
 	if userid == "" {
 		return nil, false, errors.New("未登录"), true
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 
 	if pageFlag == "" {
 		return nil, false, errors.New("未知请求"), true
@@ -59,14 +60,15 @@ func CreatePortraitManager(userid string, pageFlag string) (*Portrait, bool, err
  * 3.免费用户(如免费用户、老版商机管理、老版超级订阅)通过一次留资可以解锁画像权限,查看画像的所有内容。
  */
 // CreatePortraitManagerForContacts 画像通讯里权限验证
-func CreatePortraitManagerForContacts(userid string, entType int64, entName string) (*Portrait, error) {
+func CreatePortraitManagerForContacts(userid string, baseUserId, accountId, entId int64, entType int64, entName string) (*Portrait, error) {
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
 	if entName == "" {
 		return nil, errors.New("参数异常")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	//0:采购单位;1:中标企业
 	switch entType {
 	case 0:
@@ -110,7 +112,7 @@ func CreatePortraitManagerForContacts(userid string, entType int64, entName stri
 
 //CreateSubVipPortraitManager 超级订阅权限校验
 //int -1无权限 1免费权限 2超级订阅次数&采购单位流量包 3使用体验
-func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, isWinner bool) (*Portrait, int, error, bool) {
+func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, isWinner bool, baseUserId, accountId, entId int64) (*Portrait, int, error, bool) {
 	if userid == "" {
 		return nil, -1, errors.New("未登录"), true
 	}
@@ -118,7 +120,8 @@ func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, is
 		return nil, -1, errors.New("未知请求"), true
 	}
 	if pageFlag != "entDetail" { //需要权限校验的接口
-		bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 		if bigMsg.VipStatus <= 0 || bigMsg.Vip_BuySet.Upgrade != 1 { //免费用户留资体验
 			if searchValue != "" && jy.Portraitexperience(userid, searchValue, isWinner) {
 				return &Portrait{userid}, 3, nil, true

+ 5 - 3
src/jfw/modules/bigmember/src/entity/trial.go

@@ -1,13 +1,15 @@
 package entity
 
 import (
-	"jy/src/jfw/modules/bigmember/src/db"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
 )
 
-func GetUserTrialInfoById(userId string) map[string]interface{} {
+func GetUserTrialInfoById(userId string, baseUserId, accountId, entId int64) map[string]interface{} {
 	var res = map[string]interface{}{}
-	BigMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+	BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	if BigMsg != nil {
 		//i_member_status:4 正在试用 ;i_member_trial:1是试用过;同时满足:当前试用阶段
 		//member_trial:0:未试用过;1:正在试用;-1:已试用过;

+ 7 - 2
src/jfw/modules/bigmember/src/filter/sessionfilter.go

@@ -2,9 +2,11 @@ package filter
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"net/http"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"regexp"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
@@ -33,6 +35,9 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		return true
 	}
 	userId, ok := session.Get("userId").(string)
+	baseUserId := qu.Int64All(session.Get("base_user_id"))
+	entId := qu.Int64All(session.Get("entId"))
+	accountId := qu.Int64All(session.Get("accountId"))
 	if !ok || userId == "" {
 		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
 		return false
@@ -41,7 +46,7 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	if req.URL.Path == "/bigmember/decision/freeDecInfo" || req.URL.Path == "/bigmember/analysis/projectName" || req.URL.Path == "/bigmember/analysis/projectInfo" || req.URL.Path == "/bigmember/project/getPdfDetail" {
 		return true
 	}
-	bigMeg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 	if !bigMeg.CheckBigVipBackPower(match[1]) {
 		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
 		return false

+ 87 - 6
src/jfw/modules/bigmember/src/go.mod

@@ -3,38 +3,119 @@ module jy/src/jfw/modules/bigmember/src
 go 1.18
 
 require (
+	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d
 	app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170
-	app.yhyue.com/moapp/jypkg v0.0.0-20221229090523-854669eee0ff
+	app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4
 	github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4
+	github.com/gogf/gf/v2 v2.0.6
+	github.com/zeromicro/go-zero v1.4.3
 	go.mongodb.org/mongo-driver v1.11.1
-	gopkg.in/olivere/elastic.v1 v1.0.1
 )
 
 require (
-	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c // indirect
+	github.com/BurntSushi/toml v0.4.1 // indirect
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
+	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/clbanning/mxj/v2 v2.5.5 // indirect
+	github.com/coreos/go-semver v0.3.0 // indirect
+	github.com/coreos/go-systemd/v22 v22.3.2 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f // indirect
+	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+	github.com/fatih/color v1.13.0 // indirect
+	github.com/felixge/fgprof v0.9.3 // indirect
+	github.com/fsnotify/fsnotify v1.5.1 // indirect
 	github.com/garyburd/redigo v1.6.2 // indirect
-	github.com/go-sql-driver/mysql v1.6.0 // indirect
+	github.com/go-logr/logr v1.2.3 // indirect
+	github.com/go-logr/stdr v1.2.2 // indirect
+	github.com/go-redis/redis/v8 v8.11.5 // indirect
+	github.com/go-sql-driver/mysql v1.7.0 // indirect
+	github.com/gogo/protobuf v1.3.2 // indirect
+	github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
+	github.com/golang/mock v1.6.0 // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gomodule/redigo v1.8.9 // indirect
+	github.com/google/go-cmp v0.5.9 // indirect
+	github.com/google/gofuzz v1.2.0 // indirect
+	github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
+	github.com/google/uuid v1.3.0 // indirect
+	github.com/googleapis/gnostic v0.5.5 // indirect
+	github.com/gorilla/websocket v1.5.0 // indirect
+	github.com/grokify/html-strip-tags-go v0.0.1 // indirect
+	github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
 	github.com/howeyc/fsnotify v0.9.0 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
 	github.com/jinzhu/now v1.1.1 // indirect
+	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
+	github.com/longbridgeapp/sqlparser v0.3.1 // indirect
+	github.com/mattn/go-colorable v0.1.9 // indirect
+	github.com/mattn/go-isatty v0.0.14 // indirect
+	github.com/mattn/go-runewidth v0.0.13 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
 	github.com/nsqio/go-nsq v1.1.0 // indirect
+	github.com/olekukonko/tablewriter v0.0.5 // indirect
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
+	github.com/openzipkin/zipkin-go v0.4.0 // indirect
+	github.com/pelletier/go-toml/v2 v2.0.6 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
+	github.com/prometheus/client_golang v1.13.0 // indirect
+	github.com/prometheus/client_model v0.2.0 // indirect
+	github.com/prometheus/common v0.37.0 // indirect
+	github.com/prometheus/procfs v0.8.0 // indirect
+	github.com/rivo/uniseg v0.2.0 // indirect
 	github.com/robfig/cron v1.2.0 // indirect
+	github.com/spaolacci/murmur3 v1.1.0 // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
+	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
+	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
+	go.etcd.io/etcd/client/v3 v3.5.5 // indirect
+	go.opentelemetry.io/otel v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/jaeger v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/zipkin v1.10.0 // indirect
+	go.opentelemetry.io/otel/sdk v1.10.0 // indirect
+	go.opentelemetry.io/otel/trace v1.10.0 // indirect
+	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
+	go.uber.org/atomic v1.9.0 // indirect
+	go.uber.org/automaxprocs v1.5.1 // indirect
+	go.uber.org/multierr v1.8.0 // indirect
+	go.uber.org/zap v1.21.0 // indirect
 	golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
-	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
-	golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 // indirect
+	golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
+	golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
+	golang.org/x/sync v0.1.0 // indirect
+	golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
+	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
+	golang.org/x/text v0.4.0 // indirect
+	golang.org/x/time v0.3.0 // indirect
+	google.golang.org/appengine v1.6.7 // indirect
+	google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e // indirect
+	google.golang.org/grpc v1.51.0 // indirect
+	google.golang.org/protobuf v1.28.1 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
+	gopkg.in/inf.v0 v0.9.1 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
+	k8s.io/api v0.22.9 // indirect
+	k8s.io/apimachinery v0.22.9 // indirect
+	k8s.io/client-go v0.22.9 // indirect
+	k8s.io/klog/v2 v2.80.1 // indirect
+	k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect
+	sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
+	sigs.k8s.io/yaml v1.2.0 // indirect
 )

File diff suppressed because it is too large
+ 530 - 5
src/jfw/modules/bigmember/src/go.sum


+ 6 - 2
src/jfw/modules/bigmember/src/service/analysis/decision.go

@@ -4,7 +4,7 @@ package analysis
 import (
 	"encoding/json"
 	"fmt"
-	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
@@ -78,9 +78,13 @@ func (this *Analysis) ProjectInfoByBW() {
 func (this *Analysis) TrialInfo() {
 	defer qutil.Catch()
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		//userInfo, ok := db.Mgo.FindById("user", userId, nil)
-		baseMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+		baseMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 		if baseMsg == nil {
 			return -2, nil
 		}

+ 5 - 1
src/jfw/modules/bigmember/src/service/analysis/forecastproject.go

@@ -4,6 +4,7 @@ package analysis
 import (
 	"encoding/json"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/util"
 
@@ -128,6 +129,9 @@ func getForecastProjectSql(scd *util.ViewCondition) string {
 func (this *Analysis) ForPContent() {
 	defer qutil.Catch()
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		id := this.GetString("id")     //项目预测id
 		keys := this.GetString("keys") //关键词
@@ -186,7 +190,7 @@ func (this *Analysis) ForPContent() {
 				}
 			}
 			power := []int{}
-			powerMap := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo).PowerMap
+			powerMap := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile).PowerMap
 			for k, _ := range powerMap {
 				power = append(power, k)
 			}

+ 16 - 6
src/jfw/modules/bigmember/src/service/analysis/potential.go

@@ -3,15 +3,15 @@ package analysis
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"encoding/json"
+	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
-	"encoding/json"
 	"jy/src/jfw/modules/bigmember/src/entity"
-	"fmt"
 	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-	"app.yhyue.com/moapp/jybase/redis"
 	"sort"
 	"strings"
 	"sync"
@@ -25,6 +25,9 @@ import (
 // 大会员首页
 func (this *Analysis) PotIndex() {
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	defer qutil.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
@@ -37,6 +40,9 @@ func (this *Analysis) PotIndex() {
 			json.Unmarshal(this.Body(), &ptst)
 		}
 		ptst.UserId = userId
+		ptst.BaseUserId = baseUserId
+		ptst.AccountId = accountId
+		ptst.EntId = entId
 		if !ptst.UserStatusChecked() {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
@@ -126,6 +132,9 @@ func (this *Analysis) CsORRsList() {
 	}
 	if this.Method() == METHOD {
 		userId, _ := this.GetSession("userId").(string)
+		baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+		entId := qutil.Int64All(this.GetSession("entId"))
+		accountId := qutil.Int64All(this.GetSession("accountId"))
 		var entName = "" //企业名称
 		//接受前端参数
 		getRes := new(SelectC)
@@ -166,7 +175,8 @@ func (this *Analysis) CsORRsList() {
 				log.Println("大会员初始化 企业名称有误-", userId, main_userId)
 			}
 			//userInfo, ok := db.Mgo.FindById("user", main_userId, nil)
-			userInfo := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+			userInfo := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 			if userInfo != nil {
 				var isTrial = userInfo.Status == 4
 				var c_limitcount = 5

+ 9 - 4
src/jfw/modules/bigmember/src/service/analysis/util.go

@@ -1,19 +1,20 @@
 package analysis
 
 import (
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"bytes"
 	"crypto/hmac"
 	"crypto/sha1"
-	"jy/src/jfw/modules/bigmember/src/db"
 	"encoding/base64"
 	"encoding/json"
 	"hash"
 	"io"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"net/url"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"sort"
 	"strings"
-	"jy/src/jfw/modules/bigmember/src/util"
 )
 
 type SignStr struct {
@@ -35,6 +36,9 @@ type SelectC struct {
 	IsIndex        bool                   //是否首页查询
 	EntName        string                 //我的企业
 	UserId         string
+	BaseUserId     int64
+	EntId          int64
+	AccountId      int64
 }
 
 // UserStatusChecked 查看权限
@@ -43,7 +47,8 @@ func (this *SelectC) UserStatusChecked() bool {
 	if this.PCOR == "R" {
 		serviceId = 8
 	}
-	userPower := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
+	userPower := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, this.EntId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	return userPower.Status > 0 && userPower.PowerMap[serviceId]
 }
 

+ 7 - 3
src/jfw/modules/bigmember/src/service/bidfile/bidfile.go

@@ -1,6 +1,7 @@
 package bidfile
 
 import (
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/util"
 	"time"
@@ -22,6 +23,9 @@ type Bidfile struct {
 func (b *Bidfile) History() {
 	r := func() Result {
 		userid := qu.ObjToString(b.GetSession("userId"))
+		baseUserId := qu.Int64All(b.GetSession("base_user_id"))
+		entId := qu.Int64All(b.GetSession("entId"))
+		accountId := qu.Int64All(b.GetSession("accountId"))
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
@@ -33,11 +37,11 @@ func (b *Bidfile) History() {
 		}
 		//获取用户权限详情
 		power := []int{}
-		bigPower := jy.GetBigVipUserBaseMsg(mainid, db.Mysql, db.Mgo)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
 		}
-		res := db.Mysql.SelectBySql(`select explain_time,user_id from bidfile_history 
+		res := db.Mysql.SelectBySql(`select explain_time,user_id from bidfile_history
 		where main_id=?
 		and is_delete =0 and explain_time is not null order by explain_time desc`, userid)
 		userPhoneMap := map[string]string{}
@@ -60,7 +64,7 @@ func (b *Bidfile) History() {
 		}
 		bidfile_endtime := "2021年11月15日" //目前招标文件解读到11/15到期
 		bed := GetTime("2006年01月02日", bidfile_endtime)
-		d := db.Mysql.SelectBySql(`SELECT l_endtime AS endtime FROM bigmember_service_user 
+		d := db.Mysql.SelectBySql(`SELECT l_endtime AS endtime FROM bigmember_service_user
 				WHERE s_serviceid =11 AND s_userid =? AND i_status = 0`, mainid)
 		if d != nil && len(*d) > 0 {
 			endtime := qu.ObjToString((*d)[0]["endtime"])

+ 35 - 11
src/jfw/modules/bigmember/src/service/follow/enterprise.go

@@ -2,12 +2,12 @@ package follow
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	"jy/src/jfw/modules/bigmember/src/entity"
+	qutil "app.yhyue.com/moapp/jybase/common"
 	"errors"
 	"fmt"
-	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
+	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
+	"log"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
@@ -28,13 +28,16 @@ type FollowEnt struct {
 // Association 中标企业联想
 func (this *FollowEnt) Association() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entName := this.GetString("entName")
 		returnData := []map[string]interface{}{}
 		if entName == "" {
 			return returnData, nil
 		}
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -53,8 +56,11 @@ func (this *FollowEnt) Association() {
 // FollowCheck 企业是否关注
 func (this *FollowEnt) FollowCheck() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -76,8 +82,11 @@ func (this *FollowEnt) FollowCheck() {
 // List 关注中标企业列表
 func (this *FollowEnt) List() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -109,8 +118,11 @@ func (this *FollowEnt) List() {
 
 func (this *FollowEnt) PcSimpleFollowList() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -133,12 +145,15 @@ func (this *FollowEnt) PcSimpleFollowList() {
 // AddFollow 添加关注企业
 func (this *FollowEnt) AddFollow() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := this.GetString("entId")
 		if entId == "" {
 			return nil, errors.New("企业为空")
 		}
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -157,9 +172,12 @@ func (this *FollowEnt) AddFollow() {
 // DelFollow 取关企业
 func (this *FollowEnt) DelFollow() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := this.GetString("entId")
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -178,8 +196,11 @@ func (this *FollowEnt) DelFollow() {
 // EntChangeList 企业基本信息变更
 func (this *FollowEnt) EntChangeList() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, err := entity.CreateEntFollowManager(userId, "entChange")
+		cepm, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId, "entChange")
 
 		if err != nil {
 			return nil, err
@@ -205,8 +226,11 @@ func (this *FollowEnt) EntChangeList() {
 // ChangeGroup 更换关注企业分组
 func (this *FollowEnt) ChangeGroup() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, err := entity.CreateEntFollowManager(userId)
+		cepm, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}

+ 43 - 13
src/jfw/modules/bigmember/src/service/follow/project.go

@@ -2,13 +2,13 @@ package follow
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	"jy/src/jfw/modules/bigmember/src/entity"
+	qutil "app.yhyue.com/moapp/jybase/common"
 	"errors"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/entity"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
 	"strings"
-	"jy/src/jfw/modules/bigmember/src/util"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
@@ -33,8 +33,11 @@ type FollowProject struct {
 // AddProject 项目关注
 func (this *FollowProject) AddProject() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -58,8 +61,11 @@ func (this *FollowProject) AddProject() {
 // CancelProject 取消关注
 func (this *FollowProject) CancelProject() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -83,8 +89,11 @@ func (this *FollowProject) CancelProject() {
 // FollowCheck 是否关注项目
 func (this *FollowProject) FollowCheck() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -110,11 +119,14 @@ func (this *FollowProject) FollowList() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	entUserId := qutil.IntAll(this.GetSession("entUserId"))
 	isClaim := qutil.IntAll(this.GetString("isClaim"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	name := this.GetString("name")
 	area := this.GetString("area")
 	areaAll := strings.Split(area, ",")
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -173,8 +185,11 @@ func IsArea(areaAll []string, area string) bool {
 // FollowDetail 关注项目详情页&设置
 func (this *FollowProject) FollowDetail() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -265,8 +280,11 @@ func mergeFollowDetail(followInfo, projectInfo map[string]interface{}, sid strin
 // FollowRead 项目信息已读
 func (this *FollowProject) FollowRead() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -290,8 +308,11 @@ func (this *FollowProject) FollowRead() {
 // Remove30Day 批量删除30天没有更新的项目
 func (this *FollowProject) Remove30Day() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -313,8 +334,11 @@ func (this *FollowProject) Remove30Day() {
 // AddTime 添加提醒时间&开标时间
 func (this *FollowProject) AddTime() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -339,8 +363,11 @@ func (this *FollowProject) AddTime() {
 // RemindSwitch 项目提醒开关
 func (this *FollowProject) RemindSwitch() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -363,9 +390,12 @@ func (this *FollowProject) RemindSwitch() {
 // ScreenArea 获取已关注的项目地区
 func (this *FollowProject) ScreenArea() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	entUserId := qutil.IntAll(this.GetSession("entUserId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}

+ 15 - 11
src/jfw/modules/bigmember/src/service/follow/projectPdf.go

@@ -2,22 +2,22 @@ package follow
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	"jy/src/jfw/modules/bigmember/src/config"
-	"jy/src/jfw/modules/bigmember/src/db"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	elastic "app.yhyue.com/moapp/jybase/esv1"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
-	"app.yhyue.com/moapp/jybase/mongodb"
 	"net"
 	"net/http"
-	qutil "app.yhyue.com/moapp/jybase/common"
-	elastic "app.yhyue.com/moapp/jybase/esv1"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"regexp"
 	"strings"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 )
 
 var ClientPool chan *http.Client
@@ -54,13 +54,16 @@ func NewClient() *http.Client {
 //GetPdfFile 下载项目内容pdf文件
 func (this *FollowProject) GetPdfFile() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		sid := util.DecodeId(this.GetString("sid")) //获取信息id
 		if sid == "" {
 			return nil, fmt.Errorf("未知项目")
 		}
 		//校验是否为付费用户
-		if !checkPay(userId) {
+		if !checkPay(userId, baseUserId, accountId, entId) {
 			return "", fmt.Errorf("非法请求")
 		}
 		pid, lastTime, err := getProjectSimpleData(sid)
@@ -121,8 +124,9 @@ func (this *FollowProject) GetPdfDetail() {
 }
 
 //校验是否是付费用户
-func checkPay(userId string) bool {
-	bigPower := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+func checkPay(userId string, baseUserId, accountId, entId int64) bool {
+	bigPower := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	if bigPower.Status > 0 || bigPower.VipStatus > 0 {
 		return true
 	}
@@ -141,7 +145,7 @@ func checkPay(userId string) bool {
 	}
 	res := db.Mysql.SelectBySql(`SELECT i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
 			ON u.ent_id=i.id
-			WHERE u.phone=? 
+			WHERE u.phone=?
 			ORDER BY  i.status DESC,i.auth_status DESC, CASE WHEN i.phone=? THEN 0  ELSE 1 END  ASC`, phone, phone)
 	if res != nil && len(*res) > 0 {
 		for _, v := range *res {

+ 57 - 15
src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go

@@ -39,8 +39,11 @@ type EntPortrait struct {
 //EntDetail 企业基本信息
 func (this *EntPortrait) EntDetail() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, _, err, _ := entity.CreatePortraitManager(userId, "entDetail")
+		cepm, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entId, "entDetail")
 		if err != nil {
 			return nil, err
 		}
@@ -60,8 +63,11 @@ func (this *EntPortrait) EntDetail() {
 //WinnerContacts 中标企业历史联系人
 func (this *EntPortrait) WinnerContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "entPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entId, "entPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -86,19 +92,22 @@ func (this *EntPortrait) WinnerContacts() {
 // WinnerSelects 企业画像可供筛选的条件
 func (this *EntPortrait) WinnerSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		_, _, err, _ := entity.CreatePortraitManager(userId, "entNewMsg")
+		_, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entNewMsg")
 		if err != nil {
 			return nil, err
 		}
 		//if !hasPower {
 		//	return nil, fmt.Errorf("非法请求")
 		//}
-		pwp := &entity.PortraitScreen{Ent: entId}
+		pwp := &entity.PortraitScreen{Ent: qutil.InterfaceToStr(entId)}
 		return pwp.GetProjectSelectItems(true)
 	}()
 	if errMsg != nil {
@@ -110,12 +119,15 @@ func (this *EntPortrait) WinnerSelects() {
 //WinnerNewMsg 企业画像-最新项目动态
 func (this *EntPortrait) WinnerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "entNewMsg")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entNewMsg")
 		if err != nil {
 			return nil, err
 		}
@@ -156,12 +168,15 @@ func (this *EntPortrait) WinnerNewMsg() {
 //WinnerNewMsgExport 企业画像-最新项目动态
 func (this *EntPortrait) WinnerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, "entNewMsg")
+		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entNewMsg")
 		if err != nil {
 			return nil, err
 		}
@@ -207,8 +222,11 @@ func (this *EntPortrait) WinnerNewMsgExport() {
 //WinnerPortrait 企业画像-画像数据查询
 func (this *EntPortrait) WinnerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "entPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -237,8 +255,11 @@ func (this *EntPortrait) WinnerPortrait() {
 //WinnerMiniPortrait 三级页中标单位引流数据展示(免费)
 func (this *EntPortrait) WinnerMiniPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, _, err, _ := entity.CreatePortraitManager(userId, "entPortrait")
+		cepm, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -271,12 +292,15 @@ func (this *EntPortrait) WinnerMiniPortrait() {
 //dev.6.2.1免费用户可筛选画像
 func (this *EntPortrait) BuyerSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		_, _, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		_, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -292,8 +316,11 @@ func (this *EntPortrait) BuyerSelects() {
 //BuyerNewMsg 采购单位画像-最新招标动态(免费用户仅可查看3条记录,付费50条)
 func (this *EntPortrait) BuyerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -333,8 +360,11 @@ func (this *EntPortrait) BuyerNewMsg() {
 
 func (this *EntPortrait) BuyerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -378,8 +408,11 @@ func (this *EntPortrait) BuyerNewMsgExport() {
 //BuyerContacts 采购单位联系人(必须开通会员)
 func (this *EntPortrait) BuyerContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -404,8 +437,11 @@ func (this *EntPortrait) BuyerContacts() {
 //BuyerPortrait 采购单位画像-数据(免费用户可查看基本信息、项目统计、合作企业资本、年龄及地区分布)
 func (this *EntPortrait) BuyerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -435,8 +471,11 @@ func (this *EntPortrait) BuyerPortrait() {
 //BuyerMiniPortrait 三级页采购单位引流数据展示(免费)
 func (this *EntPortrait) BuyerMiniPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, _, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -476,11 +515,14 @@ func (this *EntPortrait) BuyerMiniPortrait() {
 // PortraitContacts 画像通讯录
 func (this *EntPortrait) PortraitContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entType, _ := this.GetInt("entType")
 		entName := this.GetString("entName")
 		// 画像通讯里访问权限
-		cepm, err := entity.CreatePortraitManagerForContacts(userId, entType, entName)
+		cepm, err := entity.CreatePortraitManagerForContacts(userId, baseUserId, accountId, entid, entType, entName)
 
 		if err != nil {
 			return nil, err

+ 50 - 12
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -3,6 +3,7 @@ package portrait
 import (
 	"errors"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
@@ -40,12 +41,15 @@ type SubVipPortrait struct {
 //SubVipEntDetail 超级订阅升级版查询基本信息
 func (this *SubVipPortrait) SubVipEntDetail() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entDetail", entId, true)
+		cepm, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entDetail", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -64,12 +68,15 @@ func (this *SubVipPortrait) SubVipEntDetail() {
 //SubVipWinnerNewMsg 超级订阅升级版查看最新中标动态
 func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -111,12 +118,15 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 //WinnerNewMsgExport 超级订阅升级版查看最新中标动态数据导出
 func (this *SubVipPortrait) WinnerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
+		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -162,12 +172,15 @@ func (this *SubVipPortrait) WinnerNewMsgExport() {
 //SubVipNewMsgSelects 获取画像可筛选项
 func (this *SubVipPortrait) SubVipNewMsgSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
+		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -183,12 +196,15 @@ func (this *SubVipPortrait) SubVipNewMsgSelects() {
 //SubVipPortrait 超级订阅升级版查看企业画像
 func (this *SubVipPortrait) SubVipPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -216,8 +232,12 @@ func (this *SubVipPortrait) SubVipPortrait() {
 //PortraitUsage 超级订阅升级版画像浏览量查询
 func (this *SubVipPortrait) PortraitUsage() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		bigMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 		if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
 			return nil, fmt.Errorf("非法请求")
 		}
@@ -249,6 +269,9 @@ func (this *SubVipPortrait) PortraitUsage() {
 //PortraitRecord 超级订阅升级版画像查看记录
 func (this *SubVipPortrait) PortraitRecord() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		year, _ := this.GetInteger("year")
 		month, _ := this.GetInteger("month")
@@ -261,7 +284,7 @@ func (this *SubVipPortrait) PortraitRecord() {
 		if pageSize < 1 || pageSize > 50 {
 			pageSize = 50
 		}
-		bigMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
 			return nil, fmt.Errorf("非法请求")
 		}
@@ -305,12 +328,15 @@ func (this *SubVipPortrait) PortraitRecord() {
 //BuyerSelects 超级订阅筛选画像
 func (this *SubVipPortrait) BuyerSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
+		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -326,6 +352,9 @@ func (this *SubVipPortrait) BuyerSelects() {
 //BuyerNewMsg 超级订阅采购单位画像动态
 func (this *SubVipPortrait) BuyerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
@@ -333,7 +362,7 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 		}
 		pageNum, _ := this.GetInteger("pageNum")
 		pageSize, _ := this.GetInteger("pageSize")
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -369,12 +398,15 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 //BuyerNewMsgExport 超级订阅采购单位画像动态数据导出
 func (this *SubVipPortrait) BuyerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
+		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -416,12 +448,15 @@ func (this *SubVipPortrait) BuyerNewMsgExport() {
 //BuyerContacts 超级订阅采购单位联系人
 func (this *SubVipPortrait) BuyerContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyerName := this.GetString("buyer")
 		if buyerName == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -445,12 +480,15 @@ func (this *SubVipPortrait) BuyerContacts() {
 //BuyerPortrait 超级订阅采购单位画像-数据
 func (this *SubVipPortrait) BuyerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyerName := this.GetString("buyer")
 		if buyerName == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}

+ 15 - 8
src/jfw/modules/bigmember/src/service/push/push.go

@@ -2,11 +2,12 @@ package push
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	. "jy/src/jfw/modules/bigmember/src/db"
-	"encoding/json"
-	"log"
 	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"encoding/json"
+	"jy/src/jfw/modules/bigmember/src/config"
+	. "jy/src/jfw/modules/bigmember/src/db"
+	"log"
 	"time"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
@@ -37,6 +38,9 @@ type pushSet struct {
 //4.6.0修改 只把有权益的存入map返给前端, k:权益 v:是否开启
 func (a *Action) Items() {
 	userId, _ := a.GetSession("userId").(string)
+	baseUserId := util.Int64All(a.GetSession("base_user_id"))
+	entId := util.Int64All(a.GetSession("entId"))
+	accountId := util.Int64All(a.GetSession("accountId"))
 	user, _ := Mgo.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1,"s_phone":1,"s_m_phone":1,"o_member_jy":1}`)
 	s_phone, _ := (*user)["s_phone"].(string)
 	if s_phone == "" {
@@ -52,8 +56,8 @@ func (a *Action) Items() {
 	}
 	if member_status > 0 {
 		o_member_jy, _ := (*user)["o_member_jy"].(map[string]interface{})
-		data["member_subscribe"] = OpenStatus(o_member_jy, "member_subscribe", userId) //大会员订阅
-		delete(data, "free_subscribe")                                                 //有大会员订阅没有免费订阅
+		data["member_subscribe"] = OpenStatus(o_member_jy, "member_subscribe", userId, baseUserId, accountId, entId) //大会员订阅
+		delete(data, "free_subscribe")                                                                               //有大会员订阅没有免费订阅
 	}
 	if member_status <= 0 && vip_status <= 0 {
 		data["follow_ent"] = true     //企业关注
@@ -72,6 +76,9 @@ func (a *Action) Items() {
 }
 func (a *Action) Detail() {
 	userId, _ := a.GetSession("userId").(string)
+	baseUserId := util.Int64All(a.GetSession("base_user_id"))
+	entId := util.Int64All(a.GetSession("entId"))
+	accountId := util.Int64All(a.GetSession("accountId"))
 	if !R.CheckReqParam(a.ResponseWriter, a.Request, "item") {
 		return
 	}
@@ -95,7 +102,7 @@ func (a *Action) Detail() {
 			"wxpush":         util.IntAll(o_member_jy["i_wxpush"]),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg(userId, Mysql, Mgo)
+		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}
@@ -387,7 +394,7 @@ func (a *Action) Update() {
 }
 
 //判断按钮是否全部开启
-func OpenStatus(ojy map[string]interface{}, types, userId string) bool {
+func OpenStatus(ojy map[string]interface{}, types, userId string, baseUserId, accountId, entId int64) bool {
 	push, data := M{}, M{}
 	pushStatus, subscribe := false, false
 	switch types {
@@ -402,7 +409,7 @@ func OpenStatus(ojy map[string]interface{}, types, userId string) bool {
 			"follow_ent":     util.IntAllDef(ojy["i_follow_ent"], 1),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg(userId, Mysql, Mgo)
+		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}

+ 15 - 6
src/jfw/modules/bigmember/src/service/report/marketAnalysis.go

@@ -5,9 +5,9 @@ import (
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/entity/marketAnalysis"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 
 	. "app.yhyue.com/moapp/jybase/api"
 	qutil "app.yhyue.com/moapp/jybase/common"
@@ -25,12 +25,12 @@ type MarketAnalysis struct {
 }
 
 // checkPower 权限校验
-func checkPower(userId string) (string, error) {
+func checkPower(userId string, baseUserId, accountId, entId int64) (string, error) {
 	if userId == "" {
 		return "", fmt.Errorf("未登录")
 	}
 	//仅购买《周报/月报/定制化市场分析报告》的大会员有权限
-	bigMeg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 	//if bigMeg.Status <= 0 || !bigMeg.CheckBigVipBackPower("report") {
 	//	return "", fmt.Errorf("非法请求")
 	//}
@@ -40,8 +40,11 @@ func checkPower(userId string) (string, error) {
 // DoAnalysis 开始分析报告
 func (this *MarketAnalysis) DoAnalysis() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		pid, powerErr := checkPower(userId)
+		pid, powerErr := checkPower(userId, baseUserId, accountId, entId)
 		if powerErr != nil {
 			return nil, powerErr
 		}
@@ -73,8 +76,11 @@ func (this *MarketAnalysis) DoAnalysis() {
 // GetAnalysisResult 获取分析结果
 func (this *MarketAnalysis) GetAnalysisResult() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		pid, powerErr := checkPower(userId)
+		pid, powerErr := checkPower(userId, baseUserId, accountId, entId)
 		if powerErr != nil {
 			return nil, powerErr
 		}
@@ -103,8 +109,11 @@ func (this *MarketAnalysis) GetAnalysisResult() {
 // AnalysisHistory 分析报告历史
 func (this *MarketAnalysis) AnalysisHistory() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		pid, powerErr := checkPower(userId)
+		pid, powerErr := checkPower(userId, baseUserId, accountId, entId)
 		if powerErr != nil {
 			return nil, powerErr
 		}

+ 5 - 2
src/jfw/modules/bigmember/src/service/trial/trial.go

@@ -2,9 +2,9 @@ package trial
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qutil "app.yhyue.com/moapp/jybase/common"
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
@@ -17,8 +17,11 @@ type Trial struct {
 func (this *Trial) UserInfo() {
 	defer qutil.Catch()
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		info := entity.GetUserTrialInfoById(userId)
+		info := entity.GetUserTrialInfoById(userId, baseUserId, accountId, entId)
 		return info, nil
 	}()
 	if errMsg != nil {

+ 178 - 134
src/jfw/modules/bigmember/src/service/use/use.go

@@ -2,25 +2,23 @@ package use
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qu "app.yhyue.com/moapp/jybase/common"
+	elastic "app.yhyue.com/moapp/jybase/esv1"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"encoding/json"
+	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
-	"encoding/json"
 	"jy/src/jfw/modules/bigmember/src/entity"
-	"fmt"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
-	"math/rand"
-	"app.yhyue.com/moapp/jybase/mongodb"
-	qu "app.yhyue.com/moapp/jybase/common"
-	elastic "app.yhyue.com/moapp/jybase/esv1"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-	"app.yhyue.com/moapp/jybase/redis"
 	"strconv"
 	"strings"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	elastic1 "app.yhyue.com/moapp/esv1/gopkg.in/olivere/elastic.v1"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
 
 type Use struct {
@@ -69,6 +67,9 @@ func (u *Use) SubPageMoveTip() {
 func (u *Use) Add() {
 	r := func() Result {
 		userid := qu.ObjToString(u.GetSession("userId"))
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
 		if userid == "" {
 			return Result{Data: M{"status": -1}, Error_msg: "未登录"}
 		}
@@ -134,13 +135,12 @@ func (u *Use) Add() {
 				}
 				set["competitor"] = competitor //竞争对手
 				set["competitorIds"] = ids     //竞争对手id
-
-				followEntManager, err := entity.CreateEntFollowManager(userid)
+				followEntManager, err := entity.CreateEntFollowManager(userid, baseUserId, accountId, entId)
 				if err != nil {
 					log.Println("add err:", userid, err)
 				} else if followEntManager.HasPower {
 					for k, v := range ids {
-						BigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+						BigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 						if BigMsg.Status != 4 {
 							err = followEntManager.AddFollowEnt(v, "", true)
 							if err != nil {
@@ -440,6 +440,9 @@ func (u *Use) Attachment() {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
 		//前端传的是加密的id 需要解密
 		infoId := util.DecodeId(u.GetString("infoId")) //"5ddf222ce9d1f601e469e00c  5f50c37dc0145440737556d0"
 		// 调用rpc
@@ -452,7 +455,7 @@ func (u *Use) Attachment() {
 			rep.Rep = []map[string]interface{}{}
 		}
 		m := rep.Rep
-		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		BaseMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		status := BaseMsg.Status
 		if status <= 0 {
 			for _, v := range m {
@@ -496,6 +499,9 @@ func (u *Use) Equity() {
 				"customers": config.Config.Customers,
 			}, Error_msg: "未登录"}
 		}
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
 		person, ok := db.Mgo.FindOneByField("user", map[string]interface{}{
 			"_id": mongodb.StringTOBsonId(userid),
 		}, `{"s_nickname":1,"s_headimageurl":1,"s_phone":1,"i_member_status":1,"i_member_endtime":1,"o_member_jy":1,"s_member_mainid":1,"i_member_sub_status":1,"i_bidfileCount":1}`)
@@ -538,7 +544,7 @@ func (u *Use) Equity() {
 			account := SubAccout(userid)          //子账号
 			surplus, _ := GetSurplusCount(userid) //剩余次数
 			power := []int{}                      //GetNewPower(userid)
-			powerMap := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo).PowerMap
+			powerMap := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile).PowerMap
 			for k, _ := range powerMap {
 				power = append(power, k)
 			}
@@ -650,129 +656,164 @@ type UserInfo struct {
 //是否使用过首次使用
 func (u *Use) IsAdd() {
 	r := func() Result {
-		uRefer := u.Refer()
+		//uRefer := u.Refer()
 		userid := qu.ObjToString(u.GetSession("userId"))
-		phone, _ := u.GetSession("phone").(string)
-		entId := qu.IntAll(u.GetSession("entId"))
-		if userid == "" {
-			return Result{Data: nil, Error_msg: "未登录"}
-		}
-		var (
-			userInfo      = &UserInfo{}
-			userCacheBool = false
-		)
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
+		var userInfo = &UserInfo{}
 
-		baseInfoCacheKey := fmt.Sprintf(jy.IsGetUserBaseInfoRedisKey, userid)
-		if bytes, err := redis.GetBytes(jy.BaseInfoCacheDb, baseInfoCacheKey); err == nil && len(*bytes) > 0 {
-			err = json.Unmarshal(*bytes, &userInfo)
-			if err == nil {
-				userCacheBool = true
-			} else {
-				log.Println("缓存异常")
-			}
-		}
-		if !userCacheBool {
-			bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
-			userInfo = &UserInfo{
-				BigMemberStatus: bigPower.Status,
-				Combo:           level_map[bigPower.Status],
-				IsSubCount:      bigPower.Pid != "",
-				IsMemberTrial:   bigPower.HasTrial,
-				IsUsed:          bigPower.Used,
-				EntName:         bigPower.EntName,
-				EntNiche:        bigPower.EntnicheStatus > 0,
-				VipStatus:       bigPower.VipStatus,
-				Viper:           bigPower.Vip_BuySet.Upgrade > 0,
-				IsFree:          bigPower.VipStatus <= 0 && bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0,
-				IsFreeUpgrade:   bigPower.IsUpgrade,
-				EntIsNew:        bigPower.EntIsNew,
-				IsEntService:    bigPower.IsEntService,
-				MemberPowerType: bigPower.MemberPowerType,
-				VipPowerType:    bigPower.VipPowerType,
-			}
-			log.Println(entId, "----", phone)
-			if entId == 0 && phone != "" {
-				entId = initEntSess(phone)
-			}
-			log.Println(entId, "--111--", phone)
-			if entId > 0 && bigPower.EntInfo[entId] != nil {
-				userInfo.EntName = bigPower.EntInfo[entId].Name
-				userInfo.EntRoleId = bigPower.EntInfo[entId].RoleId
-				//是否是商机管理有效用户:1、管理员;2、员工已分配功能
-				userInfo.EntNiche = bigPower.EntInfo[entId].Status == 1 && (bigPower.EntInfo[entId].IsPower || bigPower.EntInfo[entId].RoleId > 0)
-				userInfo.EntIsNew = bigPower.EntInfo[entId].IsNew && userInfo.EntNiche
-				//有商机管理服务的用户 就不是商机管理用户
-				if userInfo.IsEntService = bigPower.EntInfo[entId].IsService && bigPower.EntInfo[entId].IsPower; userInfo.IsEntService {
-					userInfo.EntIsNew = false
-					userInfo.EntNiche = false
-				}
-			}
-			power := []int{}
-			for k, _ := range bigPower.PowerMap {
-				power = append(power, k)
-			}
-			userInfo.Powers = power
-			//是否是免费用户
-			userInfo.IsFree = bigPower.VipStatus <= 0 && bigPower.Status <= 0 && !userInfo.EntNiche
-			//存储缓存
-			go func() {
-				if bytes, err := json.Marshal(userInfo); err == nil && bytes != nil {
-					if redis.PutBytes(jy.BaseInfoCacheDb, baseInfoCacheKey, &bytes, config.Config.IsAddCacheTime+rand.Intn(120)) != nil {
-						log.Println("信息缓存异常")
-					}
-				}
-			}()
-		}
-		//不存缓存
-		//vip
-		if userInfo.VipStatus > 0 {
-			vipBool := true
-			if len(config.Config.IsAddUrls.Vip) > 0 && uRefer != "" {
-				vipBool = false
-				for _, v := range config.Config.IsAddUrls.Vip {
-					if strings.Contains(uRefer, v) {
-						vipBool = true
-						break
-					}
-				}
+		/*phone, _ := u.GetSession("phone").(string)
+		  entId := qu.IntAll(u.GetSession("entId"))
+		  if userid == "" {
+		          return Result{Data: nil, Error_msg: "未登录"}
+		  }
+		  var (
+		          userInfo      = &UserInfo{}
+		          userCacheBool = false
+		  )
 
-			}
-			if vipBool {
-				//没有大会员附件下载权限
-				var notBigFileBool = userInfo.BigMemberStatus <= 0 || !strings.Contains(intStringsJoin(userInfo.Powers), "3")
-				//超级订阅非大会员用户附件下载本月可用次数
-				uk := qu.If(notBigFileBool && userInfo.VipStatus > 0 && userInfo.Viper, "v", "f").(string)
-				//附件下载包的剩余次数
-				filePackKey := fmt.Sprintf(jy.FilePackNumKey, userid, fmt.Sprint(time.Now().Month()))
-				filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
-				userInfo.FileNum = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month()))) + filePackNum
-			}
-		}
-		//免费用户  // 商机管理用户 可以用免费用户的企业画像权限 留资有一次权限 所以也要验证商机管理用户
-		if userInfo.IsFree || userInfo.EntNiche {
-			freeBool := true
-			if len(config.Config.IsAddUrls.Free) > 0 && uRefer != "" {
-				freeBool = false
-				for _, v := range config.Config.IsAddUrls.Free {
-					if strings.Contains(uRefer, v) {
-						freeBool = true
-						break
-					}
-				}
+		  baseInfoCacheKey := fmt.Sprintf(jy.IsGetUserBaseInfoRedisKey, userid)
+		  if bytes, err := redis.GetBytes(jy.BaseInfoCacheDb, baseInfoCacheKey); err == nil && len(*bytes) > 0 {
+		          err = json.Unmarshal(*bytes, &userInfo)
+		          if err == nil {
+		                  userCacheBool = true
+		          } else {
+		                  log.Println("缓存异常")
+		          }
+		  }
+		  if !userCacheBool {
+		          bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		          userInfo = &UserInfo{
+		                  BigMemberStatus: bigPower.Status,
+		                  Combo:           level_map[bigPower.Status],
+		                  IsSubCount:      bigPower.Pid != "",
+		                  IsMemberTrial:   bigPower.HasTrial,
+		                  IsUsed:          bigPower.Used,
+		                  EntName:         bigPower.EntName,
+		                  EntNiche:        bigPower.EntnicheStatus > 0,
+		                  VipStatus:       bigPower.VipStatus,
+		                  Viper:           bigPower.Vip_BuySet.Upgrade > 0,
+		                  IsFree:          bigPower.VipStatus <= 0 && bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0,
+		                  IsFreeUpgrade:   bigPower.IsUpgrade,
+		                  EntIsNew:        bigPower.EntIsNew,
+		                  IsEntService:    bigPower.IsEntService,
+		                  MemberPowerType: bigPower.MemberPowerType,
+		                  VipPowerType:    bigPower.VipPowerType,
+		          }
+		          log.Println(entId, "----", phone)
+		          if entId == 0 && phone != "" {
+		                  entId = initEntSess(phone)
+		          }
+		          log.Println(entId, "--111--", phone)
+		          if entId > 0 && bigPower.EntInfo[entId] != nil {
+		                  userInfo.EntName = bigPower.EntInfo[entId].Name
+		                  userInfo.EntRoleId = bigPower.EntInfo[entId].RoleId
+		                  //是否是商机管理有效用户:1、管理员;2、员工已分配功能
+		                  userInfo.EntNiche = bigPower.EntInfo[entId].Status == 1 && (bigPower.EntInfo[entId].IsPower || bigPower.EntInfo[entId].RoleId > 0)
+		                  userInfo.EntIsNew = bigPower.EntInfo[entId].IsNew && userInfo.EntNiche
+		                  //有商机管理服务的用户 就不是商机管理用户
+		                  if userInfo.IsEntService = bigPower.EntInfo[entId].IsService && bigPower.EntInfo[entId].IsPower; userInfo.IsEntService {
+		                          userInfo.EntIsNew = false
+		                          userInfo.EntNiche = false
+		                  }
+		          }
+		          power := []int{}
+		          for k, _ := range bigPower.PowerMap {
+		                  power = append(power, k)
+		          }
+		          userInfo.Powers = power
+		          //是否是免费用户
+		          userInfo.IsFree = bigPower.VipStatus <= 0 && bigPower.Status <= 0 && !userInfo.EntNiche
+		          //存储缓存
+		          go func() {
+		                  if bytes, err := json.Marshal(userInfo); err == nil && bytes != nil {
+		                          if redis.PutBytes(jy.BaseInfoCacheDb, baseInfoCacheKey, &bytes, config.Config.IsAddCacheTime+rand.Intn(120)) != nil {
+		                                  log.Println("信息缓存异常")
+		                          }
+		                  }
+		          }()
+		  }
+		  //不存缓存
+		  //vip
+		  if userInfo.VipStatus > 0 {
+		          vipBool := true
+		          if len(config.Config.IsAddUrls.Vip) > 0 && uRefer != "" {
+		                  vipBool = false
+		                  for _, v := range config.Config.IsAddUrls.Vip {
+		                          if strings.Contains(uRefer, v) {
+		                                  vipBool = true
+		                                  break
+		                          }
+		                  }
 
-			}
-			if freeBool {
-				//免费用户是否有关键词
-				user, ok := db.Mgo.FindById("user", userid, `{"o_jy":1}`)
-				if ok && user != nil {
-					o_jy, _ := (*user)["o_jy"].(map[string]interface{})
-					a_key, _ := o_jy["a_key"].([]interface{})
-					userInfo.FreeHasKey = len(a_key) > 0
-				}
-				//免费用户可查看企业画像次数//免费用户可查看采购单位画像次数//免费用户可以进行附件下载次数
-				userInfo.FreeEntPort, userInfo.FreeBuyerPort, userInfo.FreeFile = jy.FreeExperience(userid)
-			}
+		          }
+		          if vipBool {
+		                  //没有大会员附件下载权限
+		                  var notBigFileBool = userInfo.BigMemberStatus <= 0 || !strings.Contains(intStringsJoin(userInfo.Powers), "3")
+		                  //超级订阅非大会员用户附件下载本月可用次数
+		                  uk := qu.If(notBigFileBool && userInfo.VipStatus > 0 && userInfo.Viper, "v", "f").(string)
+		                  //附件下载包的剩余次数
+		                  filePackKey := fmt.Sprintf(jy.FilePackNumKey, userid, fmt.Sprint(time.Now().Month()))
+		                  filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
+		                  userInfo.FileNum = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month()))) + filePackNum
+		          }
+		  }
+		  //免费用户  // 商机管理用户 可以用免费用户的企业画像权限 留资有一次权限 所以也要验证商机管理用户
+		  if userInfo.IsFree || userInfo.EntNiche {
+		          freeBool := true
+		          if len(config.Config.IsAddUrls.Free) > 0 && uRefer != "" {
+		                  freeBool = false
+		                  for _, v := range config.Config.IsAddUrls.Free {
+		                          if strings.Contains(uRefer, v) {
+		                                  freeBool = true
+		                                  break
+		                          }
+		                  }
+
+		          }
+		          if freeBool {
+		                  //免费用户是否有关键词
+		                  user, ok := db.Mgo.FindById("user", userid, `{"o_jy":1}`)
+		                  if ok && user != nil {
+		                          o_jy, _ := (*user)["o_jy"].(map[string]interface{})
+		                          a_key, _ := o_jy["a_key"].([]interface{})
+		                          userInfo.FreeHasKey = len(a_key) > 0
+		                  }
+		                  //免费用户可查看企业画像次数//免费用户可查看采购单位画像次数//免费用户可以进行附件下载次数
+		                  userInfo.FreeEntPort, userInfo.FreeBuyerPort, userInfo.FreeFile = jy.FreeExperience(userid)
+		          }
+		  }
+		  userInfo.CustomerService = config.Config.Customers
+		  return Result{Data: userInfo}*/
+		//resp := grpc.PowerCheck.Check("10000", userid, baseUserId, accountId, entId)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		userInfo = &UserInfo{
+			BigMemberStatus: bigPower.Status,
+			Combo:           level_map[bigPower.Status],
+			IsSubCount:      bigPower.Pid != "",
+			IsMemberTrial:   bigPower.HasTrial,
+			IsUsed:          bigPower.Used,
+			EntName:         bigPower.EntName,
+			EntNiche:        bigPower.EntnicheStatus > 0,
+			VipStatus:       bigPower.VipStatus,
+			Viper:           bigPower.Vip_BuySet.Upgrade > 0,
+			IsFree:          bigPower.VipStatus <= 0 && bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0,
+			IsFreeUpgrade:   bigPower.IsUpgrade,
+			EntIsNew:        bigPower.EntIsNew,
+			MemberPowerType: bigPower.MemberPowerType,
+			VipPowerType:    bigPower.VipPowerType,
+			FileNum:         bigPower.FileNum,
+			FreeEntPort:     bigPower.FreeEntPort,
+			FreeBuyerPort:   bigPower.FreeBuyerPort,
+			FreeFile:        bigPower.FreeFile,
+			FreeHasKey:      bigPower.FreeHasKey,
+		}
+		power := []int{}
+		for k, _ := range bigPower.PowerMap {
+			power = append(power, k)
 		}
+		userInfo.Powers = power
 		userInfo.CustomerService = config.Config.Customers
 		return Result{Data: userInfo}
 	}()
@@ -807,6 +848,9 @@ func (u *Use) Aiused_history() {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
 		isSub := true
 		mainid, _, member_status := util.MainUserId(userid, "", 0)
 		if mainid == userid {
@@ -814,7 +858,7 @@ func (u *Use) Aiused_history() {
 		}
 		//获取用户权限详情
 		power := []int{} //GetNewPower(userid)
-		bigPower := jy.GetBigVipUserBaseMsg(mainid, db.Mysql, db.Mgo)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
 		}

+ 4 - 5
src/jfw/modules/distribution/src/service/filter/phonefilter.go

@@ -8,7 +8,6 @@ import (
 	"regexp"
 	"strings"
 	"time"
-
 	qu "app.yhyue.com/moapp/jybase/common"
 	. "app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
@@ -71,7 +70,7 @@ func (l *phoneFilter) Do() bool {
 	}
 	href := Sysconfig.Webdomain + "/front/account/phone/bind?mode=mergeBind&redirectTo=" + encodeURIComponent(l.R.URL.String()) //wx 加密 前端用于返回
 	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
-		if person, ok := MQFW.FindById("user", mongodb.BsonIdToSId(qu.ObjToString(uid)), `{"s_phone":1,"s_m_phone":1,"l_registedate":1,"b_merge_remind":1,"i_ispush":1}`); person != nil && ok {
+		if person, ok := MQFW.FindById("user", mongodb.BsonIdToSId(qu.ObjToString(uid)), `{"s_phone":1,"s_m_phone":1,"l_registedate":1,"i_ispush":1}`); person != nil && ok {
 			s_phone := qu.ObjToString((*person)["s_phone"])
 			if s_phone == "" {
 				s_phone = qu.ObjToString((*person)["s_m_phone"])
@@ -87,9 +86,9 @@ func (l *phoneFilter) Do() bool {
 			if onLineTime.After(reg) {
 				return true
 			}
-			if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
-				return true
-			}
+			//if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
+			//	return true
+			//}
 			//取关用户
 			if i_ispush := qu.IntAll((*person)["i_ispush"]); i_ispush == 0 {
 				return true

+ 19 - 61
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
+	"jy/src/jfw/modules/publicapply/src/grpc"
 	"log"
 	"strconv"
 	"strings"
@@ -173,12 +174,12 @@ type BidInfo struct {
 }
 
 //收藏招标信息(批量收藏)|取消收藏(批量取消)
-func BidCollOrRemByIds(bidAction BidAction, userid string) map[string]interface{} {
+func BidCollOrRemByIds(bidAction BidAction, userid string,baseUserId,entId,accountId int64) map[string]interface{} {
 	var i = 0
 	ok, msg := true, ""
 	insertValue := []interface{}{}
 	maxCount := config.BidCollConfig.FreeUserCollLimit
-	isPay, _ := Power(userid, 0)
+	isPay, _ := Power(userid, baseUserId,entId,accountId)
 	redisArr := []string{}
 	if isPay {
 		maxCount = config.BidCollConfig.PayUserCollLimit
@@ -251,7 +252,7 @@ type LabelInfo struct {
 }
 
 //新增标签(并使用)|删除标签 RV0=
-func LabelAction(labInfo *LabelInfo, userid string) map[string]interface{} {
+func LabelAction(labInfo *LabelInfo, userid string,baseUserId,entId,accountId int64) map[string]interface{} {
 	ibool, ok, msg := true, true, ""
 	redisArr := []string{}
 	if labInfo.Laction == "D" && labInfo.Lids != "" {
@@ -332,7 +333,7 @@ func LabelAction(labInfo *LabelInfo, userid string) map[string]interface{} {
 				collMap[v] = true
 			}
 			maxCount := config.BidCollConfig.FreeUserCollLimit
-			isPay, _ := Power(userid, 0)
+			isPay, _ := Power(userid, baseUserId,entId,accountId)
 			if isPay {
 				maxCount = config.BidCollConfig.PayUserCollLimit
 			}
@@ -388,14 +389,14 @@ func LabelAction(labInfo *LabelInfo, userid string) map[string]interface{} {
 	}
 }
 
-func GetCollList(c *util.CollList, userid string) map[string]interface{} {
+func GetCollList(c *util.CollList, userid string,baseUserId,entId,accountId int64) map[string]interface{} {
 	pagesize_max := config.BidCollConfig.Pagesize
 	rdata := map[string]interface{}{
 		"count":        0,
 		"haveNextPage": false,
 		"res":          []map[string]interface{}{},
 	}
-	isPay, _ := Power(userid, 0)
+	isPay, _ := Power(userid, baseUserId,entId,accountId)
 	if !isPay {
 		pagesize_max = config.BidCollConfig.FreePageSize
 	}
@@ -431,76 +432,33 @@ func GetCollList(c *util.CollList, userid string) map[string]interface{} {
 }
 
 //是否是付费用户 -bool: true:是 fasle:不是
-func Power(userid string, entId int) (bool, map[string]interface{}) {
+func Power(userid string, baseUserId, entId, accountId int64) (bool, map[string]interface{}) {
 	isVip, isMember, isEnt, privatedata := false, false, false, false
 	vipstatus := 0
-	phone := ""
-	var registedate int64
-	data, ok := db.Mgo.FindById("user", userid, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1,"l_registedate":1`)
-	if data != nil && len(*data) > 0 && ok {
-		i_vip_status := qu.IntAll((*data)["i_vip_status"])
-		if i_vip_status > 1 {
+	//isVip, isMember, isEnt, privatedata
+	resp := grpc.PowerCheck.Check("10000", userid, baseUserId, accountId, entId)
+	if resp != nil {
+		if resp.Vip.Status > 1 {
 			vipstatus = 1
 			isVip = true
 		}
-		ovipjy, _ := (*data)["o_vipjy"].(map[string]interface{})
-		if ovipjy["o_buyset"] != nil {
-			o_buyset := ovipjy["o_buyset"].(map[string]interface{})
-			if o_buyset["upgrade"] != nil && isVip {
-				vipstatus = 2
-			}
+		if resp.Vip.Upgrade > 0 && isVip {
+			vipstatus = 2
 		}
-		if i_member_status := qu.IntAllDef((*data)["i_member_status"], 0); i_member_status > 0 {
+		if resp.Member.Status > 0 {
 			isMember = true
 		}
-		if s_phone, _ := (*data)["s_phone"].(string); s_phone != "" {
-			phone = s_phone
-		} else if s_m_phone, _ := (*data)["s_m_phone"].(string); s_m_phone != "" {
-			phone = s_m_phone
-		}
-		if phone != "" {
-			//已购买企业未过期
-			if entInfo := *db.Mysql.SelectBySql(`SELECT status,isNew,id,power_source FROM entniche_info WHERE id  IN (SELECT ent_id FROM entniche_user where phone = ? and power =1)`, phone); len(entInfo) > 0 {
-				for _, v := range entInfo {
-					if entId > 0 {
-						if entId == qu.IntAll(v["id"]) {
-							if qu.IntAll(v["power_source"]) == 1 {
-								break
-							} else if qu.IntAll(v["status"]) == 1 {
-								isEnt = true
-								break
-							}
-						}
-					} else {
-						if qu.IntAll(v["status"]) == 1 && qu.IntAll(v["power_source"]) != 1 {
-							isEnt = true
-							break
-						}
-					}
-					//&& qu.IntAll(v["isNew"]) == 1
-					// if qu.IntAll(v["status"]) == 1 {
-					// 	isEnt = true
-					// 	break
-					// }
-				}
-			}
-			// if db.Mysql.CountBySql(`select count(1) from entniche_user where phone = ? and power =1`, phone) > 0 {
-			// 	isEnt = true
-			// }
-			//广州移动判断
-			privatedataCount := db.Mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone)
-			if privatedataCount > 0 {
-				privatedata = true
-			}
+		if qu.IntAll(v["power_source"]) != 1 && qu.IntAll(v["status"]) == 1 {
+			isEnt = true
 		}
-		registedate, _ = (*data)["l_registedate"].(int64)
+		privatedata = resp.Ent.PrivateGD
 	}
 	return isVip || isEnt || isMember, map[string]interface{}{
 		"vip":         vipstatus,
 		"member":      isMember,
 		"entniche":    isEnt,
 		"privatedata": privatedata,
-		"registedate": registedate,
+		//"registedate": registedate,
 	}
 }
 

+ 124 - 114
src/jfw/modules/publicapply/src/bidcollection/service/service.go

@@ -1,147 +1,157 @@
 package service
 
 import (
-	"encoding/json"
-	"jy/src/jfw/modules/publicapply/src/bidcollection/entity"
-	"jy/src/jfw/modules/publicapply/src/config"
-	"jy/src/jfw/modules/publicapply/src/util"
+        "encoding/json"
+        "jy/src/jfw/modules/publicapply/src/bidcollection/entity"
+        "jy/src/jfw/modules/publicapply/src/config"
+        "jy/src/jfw/modules/publicapply/src/util"
 
-	. "app.yhyue.com/moapp/jybase/api"
-	qu "app.yhyue.com/moapp/jybase/common"
+        . "app.yhyue.com/moapp/jybase/api"
+        qu "app.yhyue.com/moapp/jybase/common"
 )
 
 //招标信息是否被收藏
 func (this *ServiceStruct) IsCollAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		if this.GetString("bids") == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		if this.GetString("label") != "" {
-			return Result{Data: entity.IsCollByBidsBackInfo(this.GetString("bids"), userId)}
-		}
-		return Result{Data: entity.IsCollByBids(this.GetString("bids"), userId)}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                if this.GetString("bids") == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                if this.GetString("label") != "" {
+                        return Result{Data: entity.IsCollByBidsBackInfo(this.GetString("bids"), userId)}
+                }
+                return Result{Data: entity.IsCollByBids(this.GetString("bids"), userId)}
+        }()
+        this.ServeJson(r)
 }
 
 //获取标签
 func (this *ServiceStruct) GetLabelAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		return Result{Data: entity.GetLabelByUser(userId)}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                return Result{Data: entity.GetLabelByUser(userId)}
+        }()
+        this.ServeJson(r)
 }
 
 //招标信息收藏|移除收藏
 func (this *ServiceStruct) BCAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		bidAction := new(entity.BidAction)
-		if string(this.Body()) == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//接收参数
-		json.Unmarshal(this.Body(), &bidAction)
-		if len((*bidAction).Binfo) == 0 {
-			return Result{Data: nil, Error_msg: Error_msg_1002}
-		}
-		m := entity.BidCollOrRemByIds(*bidAction, userId)
-		return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        entId := qu.Int64All(this.GetSession("entId"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                bidAction := new(entity.BidAction)
+                if string(this.Body()) == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //接收参数
+                json.Unmarshal(this.Body(), &bidAction)
+                if len((*bidAction).Binfo) == 0 {
+                        return Result{Data: nil, Error_msg: Error_msg_1002}
+                }
+                m := entity.BidCollOrRemByIds(*bidAction, userId, baseUserId, entId, accountId)
+                return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
+        }()
+        this.ServeJson(r)
 }
 
 //添加或绑定标签|删除标签
 func (this *ServiceStruct) LabelAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		labelInfo := new(entity.LabelInfo)
-		if string(this.Body()) == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//接收参数
-		json.Unmarshal(this.Body(), &labelInfo)
-		if len(labelInfo.Binfo) == 0 && labelInfo.Lids == "" && labelInfo.Lname == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1002}
-		}
-		m := entity.LabelAction(labelInfo, userId)
-		return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        entId := qu.Int64All(this.GetSession("entId"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                labelInfo := new(entity.LabelInfo)
+                if string(this.Body()) == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //接收参数
+                json.Unmarshal(this.Body(), &labelInfo)
+                if len(labelInfo.Binfo) == 0 && labelInfo.Lids == "" && labelInfo.Lname == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1002}
+                }
+                m := entity.LabelAction(labelInfo, userId, baseUserId, entId, accountId)
+                return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
+        }()
+        this.ServeJson(r)
 }
 
 //收藏列表
 func (this *ServiceStruct) CollList() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		collList := new(util.CollList)
-		if string(this.Body()) == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//接收参数
-		if err := json.Unmarshal(this.Body(), &collList); err != nil {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//
-		return Result{Data: entity.GetCollList(collList, userId)}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        entId := qu.Int64All(this.GetSession("entId"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                collList := new(util.CollList)
+                if string(this.Body()) == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //接收参数
+                if err := json.Unmarshal(this.Body(), &collList); err != nil {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //
+                return Result{Data: entity.GetCollList(collList, userId, baseUserId, entId, accountId)}
+        }()
+        this.ServeJson(r)
 }
 
 //新增标签
 func (this *ServiceStruct) AddLabel() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		if this.GetString("name") == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		rdata := entity.AddLab(this.GetString("name"), userId)
-		return Result{Data: rdata["labid"], Error_msg: qu.ObjToString(rdata["msg"])}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                if this.GetString("name") == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                rdata := entity.AddLab(this.GetString("name"), userId)
+                return Result{Data: rdata["labid"], Error_msg: qu.ObjToString(rdata["msg"])}
+        }()
+        this.ServeJson(r)
 }
 
 //是否有权限(超级订阅、商机管理、大会员)
 func (this *ServiceStruct) Power() {
-	defer qu.Catch()
-	userId, _ := this.GetSession("userId").(string)
-	entId := qu.IntAll(this.GetSession("entId"))
-	r := func() Result {
-		m, msg := map[string]interface{}{}, ""
-		if userId != "" {
-			_, m = entity.Power(userId, entId)
-			registedate, _ := m["registedate"].(int64)
-			m["isOld"] = registedate != 0 && registedate < config.Config.BidSearchOldUserLimit
-			delete(m, "registedate")
-			//log.Println(entity.UpdateRedis("a", userId, []string{"a", "d"}))
-		}
-		return Result{Data: m, Error_msg: msg}
-	}()
-	this.ServeJson(r)
+        defer qu.Catch()
+        userId, _ := this.GetSession("userId").(string)
+        entId := qu.Int64All(this.GetSession("entId"))
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        r := func() Result {
+                m, msg := map[string]interface{}{}, ""
+                if userId != "" {
+                        _, m = entity.Power(userId, baseUserId, entId, accountId)
+                        registedate, _ := m["registedate"].(int64)
+                        m["isOld"] = registedate != 0 && registedate < config.Config.BidSearchOldUserLimit
+                        delete(m, "registedate")
+                }
+                return Result{Data: m, Error_msg: msg}
+        }()
+        this.ServeJson(r)
 }

+ 4 - 0
src/jfw/modules/publicapply/src/config.yaml

@@ -0,0 +1,4 @@
+etcd:
+  hosts:
+  - 192.168.3.206:2379
+powercheckKey: "powercheck.rpc" #权限校验中台rpc

+ 3 - 0
src/jfw/modules/publicapply/src/config/config.go

@@ -2,6 +2,8 @@ package config
 
 import (
 	qutil "app.yhyue.com/moapp/jybase/common"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gcfg"
 )
 
 type config struct {
@@ -62,6 +64,7 @@ var AdLeaguefig *AdLeague
 var ShareConfig *ShareF
 
 func init() {
+	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
 	//程序配置文件
 	qutil.ReadConfig(&Config)
 	qutil.ReadConfig("./bidcollection.json", &BidCollConfig)

+ 88 - 3
src/jfw/modules/publicapply/src/go.mod

@@ -5,36 +5,121 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170
 	app.yhyue.com/moapp/jypkg v0.0.0-20221230014931-c9afd45ba90b
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230104083033-9639ee8efbe2
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
+	github.com/go-xweb/xweb v0.2.1
+	github.com/gogf/gf/v2 v2.0.6
+	github.com/zeromicro/go-zero v1.4.3
 	go.mongodb.org/mongo-driver v1.11.1
 )
 
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c // indirect
+	github.com/BurntSushi/toml v0.4.1 // indirect
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
+	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/clbanning/mxj/v2 v2.5.5 // indirect
+	github.com/coreos/go-semver v0.3.0 // indirect
+	github.com/coreos/go-systemd/v22 v22.3.2 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f // indirect
+	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+	github.com/fatih/color v1.13.0 // indirect
+	github.com/felixge/fgprof v0.9.3 // indirect
+	github.com/fsnotify/fsnotify v1.5.1 // indirect
 	github.com/garyburd/redigo v1.6.2 // indirect
-	github.com/go-sql-driver/mysql v1.6.0 // indirect
+	github.com/go-logr/logr v1.2.3 // indirect
+	github.com/go-logr/stdr v1.2.2 // indirect
+	github.com/go-redis/redis/v8 v8.11.5 // indirect
+	github.com/go-sql-driver/mysql v1.7.0 // indirect
+	github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6 // indirect
+	github.com/go-xweb/log v0.0.0-20140701090824-270d183ad77e // indirect
+	github.com/go-xweb/uuid v0.0.0-20140604020037-d7dce341f851 // indirect
+	github.com/gogo/protobuf v1.3.2 // indirect
+	github.com/golang/mock v1.6.0 // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gomodule/redigo v1.8.9 // indirect
+	github.com/google/go-cmp v0.5.9 // indirect
+	github.com/google/gofuzz v1.2.0 // indirect
+	github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
+	github.com/googleapis/gnostic v0.5.5 // indirect
+	github.com/gorilla/websocket v1.5.0 // indirect
+	github.com/grokify/html-strip-tags-go v0.0.1 // indirect
+	github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
 	github.com/howeyc/fsnotify v0.9.0 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
 	github.com/jinzhu/now v1.1.1 // indirect
+	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
+	github.com/longbridgeapp/sqlparser v0.3.1 // indirect
+	github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd // indirect
+	github.com/mattn/go-colorable v0.1.9 // indirect
+	github.com/mattn/go-isatty v0.0.14 // indirect
+	github.com/mattn/go-runewidth v0.0.13 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
 	github.com/nsqio/go-nsq v1.1.0 // indirect
+	github.com/olekukonko/tablewriter v0.0.5 // indirect
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
+	github.com/openzipkin/zipkin-go v0.4.0 // indirect
+	github.com/pelletier/go-toml/v2 v2.0.6 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
+	github.com/prometheus/client_golang v1.13.0 // indirect
+	github.com/prometheus/client_model v0.2.0 // indirect
+	github.com/prometheus/common v0.37.0 // indirect
+	github.com/prometheus/procfs v0.8.0 // indirect
+	github.com/rivo/uniseg v0.2.0 // indirect
 	github.com/robfig/cron v1.2.0 // indirect
+	github.com/spaolacci/murmur3 v1.1.0 // indirect
 	github.com/tealeg/xlsx v1.0.5 // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
+	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
+	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
+	go.etcd.io/etcd/client/v3 v3.5.5 // indirect
+	go.opentelemetry.io/otel v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/jaeger v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/zipkin v1.10.0 // indirect
+	go.opentelemetry.io/otel/sdk v1.10.0 // indirect
+	go.opentelemetry.io/otel/trace v1.10.0 // indirect
+	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
+	go.uber.org/atomic v1.9.0 // indirect
+	go.uber.org/automaxprocs v1.5.1 // indirect
+	go.uber.org/multierr v1.8.0 // indirect
+	go.uber.org/zap v1.21.0 // indirect
 	golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
-	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
-	golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 // indirect
+	golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
+	golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
+	golang.org/x/sync v0.1.0 // indirect
+	golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
+	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
+	golang.org/x/text v0.4.0 // indirect
+	golang.org/x/time v0.3.0 // indirect
+	google.golang.org/appengine v1.6.7 // indirect
+	google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e // indirect
+	google.golang.org/grpc v1.51.0 // indirect
+	google.golang.org/protobuf v1.28.1 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
+	gopkg.in/inf.v0 v0.9.1 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
+	k8s.io/api v0.22.9 // indirect
+	k8s.io/apimachinery v0.22.9 // indirect
+	k8s.io/client-go v0.22.9 // indirect
+	k8s.io/klog/v2 v2.80.1 // indirect
+	k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect
+	sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
+	sigs.k8s.io/yaml v1.2.0 // indirect
 )

File diff suppressed because it is too large
+ 538 - 3
src/jfw/modules/publicapply/src/go.sum


+ 17 - 57
src/jfw/modules/publicapply/src/shareFission/service/service.go

@@ -1,41 +1,22 @@
 package service
 
 import (
-<<<<<<< HEAD
-	"encoding/base64"
-	"fmt"
-	"jy/src/jfw/modules/publicapply/src/config"
-	"jy/src/jfw/modules/publicapply/src/db"
-	"jy/src/jfw/modules/publicapply/src/shareFission/entity"
-	"log"
-	"strings"
-	"time"
-
-	. "app.yhyue.com/moapp/jybase/api"
-	qu "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/redis"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
-	"github.com/SKatiyar/qr"
-=======
-    . "api"
-    "config"
-    "db"
-    "encoding/base64"
-    "fmt"
-    "log"
-    qu "qfw/util"
-    "qfw/util/jy"
-    "qfw/util/redis"
-    "shareFission/entity"
-    "strings"
-    "time"
-
-    "github.com/SKatiyar/qr"
-    "github.com/go-xweb/xweb"
->>>>>>> feature/v4.7.53
+        . "app.yhyue.com/moapp/jybase/api"
+        qu "app.yhyue.com/moapp/jybase/common"
+        "app.yhyue.com/moapp/jybase/encrypt"
+        "app.yhyue.com/moapp/jybase/redis"
+        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+        "encoding/base64"
+        "fmt"
+        "jy/src/jfw/modules/publicapply/src/config"
+        "jy/src/jfw/modules/publicapply/src/db"
+        "jy/src/jfw/modules/publicapply/src/shareFission/entity"
+        "log"
+        "strings"
+        "time"
+
+        "app.yhyue.com/moapp/jybase/go-xweb/xweb"
+        "github.com/SKatiyar/qr"
 )
 
 type Share struct {
@@ -151,31 +132,11 @@ func (this *Share) List() {
 
 //立即领取
 func (this *Share) Receive() {
-<<<<<<< HEAD
-	if !R.CheckReqParam(this.ResponseWriter, this.Request, "oid", "shareId") {
-		return
-	}
-	status, msg := func() (bool, string) {
-		openid := encrypt.SE.DecodeString(this.GetString("oid")) //被分享者openid
-		if db.Mgo.Count("user", map[string]interface{}{"s_m_openid": openid, "i_appid": 2}) > 0 {
-			return false, "老用户无法领取奖励"
-		}
-		shareId := this.GetString("shareId")
-		redisKey := fmt.Sprintf("rec_%s", openid)
-		log.Println(openid, shareId, redisKey)                              //分享者和被分享者对应关系
-		shareUserid := redis.GetStr(config.ShareConfig.ShareRedis, shareId) //获取分享者
-		if shareUserid == "" {
-			return false, "领取失败"
-		}
-		return redis.Put(config.ShareConfig.ShareRedis, redisKey, shareUserid, timeOut()), ""
-	}()
-	this.ServeJson(Result{Data: M{"status": status}, Error_msg: msg})
-=======
     if !R.CheckReqParam(this.ResponseWriter, this.Request, "oid", "shareId") {
         return
     }
     status, msg := func() (bool, string) {
-        openid := qu.SE.DecodeString(this.GetString("oid")) //被分享者openid
+        openid := encrypt.SE.DecodeString(this.GetString("oid")) //被分享者openid
         if db.Mgo.Count("user", map[string]interface{}{"s_m_openid": openid, "i_appid": 2}) > 0 {
             return false, "老用户无法领取奖励"
         }
@@ -189,7 +150,6 @@ func (this *Share) Receive() {
         return redis.Put(config.ShareConfig.ShareRedis, redisKey, shareUserid, timeOut()), ""
     }()
     this.ServeJson(Result{Data: M{"status": status}, Error_msg: msg})
->>>>>>> feature/v4.7.53
 
 }
 

+ 4 - 4
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -1,14 +1,14 @@
 package entity
 
 import (
-        "db"
+        qutil "app.yhyue.com/moapp/jybase/common"
+        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
         "fmt"
-        qutil "qfw/util"
-        "qfw/util/jy"
+        "jy/src/jfw/modules/publicapply/src/db"
+        "jy/src/jfw/modules/publicapply/src/util"
         "strconv"
         "strings"
         "time"
-        "util"
 
         "go.mongodb.org/mongo-driver/bson"
 )

+ 5 - 5
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -1,17 +1,17 @@
 package entity
 
 import (
-        "db"
+        "app.yhyue.com/moapp/jybase/redis"
+        "jy/src/jfw/modules/publicapply/src/db"
         "errors"
         "fmt"
         "log"
-        qutil "qfw/util"
-        "qfw/util/jy"
-        "qfw/util/redis"
+        qutil "app.yhyue.com/moapp/jybase/common"
+        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
         "sort"
         "strings"
         "time"
-        "util"
+        "jy/src/jfw/modules/publicapply/src/util"
 )
 
 //订阅设置设置修改

+ 5 - 6
src/jfw/modules/publicapply/src/subscribePush/service/subscribe.go

@@ -1,14 +1,13 @@
 package service
 
 import (
-        "db"
+        qutil "app.yhyue.com/moapp/jybase/common"
+        "app.yhyue.com/moapp/jybase/go-xweb/xweb"
+        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+        "jy/src/jfw/modules/publicapply/src/db"
+        "jy/src/jfw/modules/publicapply/src/subscribePush/entity"
         "log"
-        qutil "qfw/util"
-        "qfw/util/jy"
         "strings"
-        "subscribePush/entity"
-
-        "github.com/go-xweb/xweb"
 )
 
 type Subscribe struct {

+ 3 - 0
src/jfw/modules/subscribepay/src/a/init.go

@@ -34,6 +34,9 @@ func init() {
 	xweb.AddRouter("/subscribepay", &service.OrderDetail{})      //订单详情(详情页统一接口)
 	xweb.AddRouter("/subscribepay", &service.SubscribeChange{})  //续费&升级&订阅修改
 
+	//手机号异常验证
+	xweb.AddRouter("/subscribepay", &service.ExceptionVerification{}) //虚拟手机号验证
+
 	xweb.AddRouter("/subscribepay", &report.Report{}) //订阅报告
 	//p1
 	xweb.AddRouter("/subscribepay", &service.IndexSearch{}) //续费&升级

+ 79 - 0
src/jfw/modules/subscribepay/src/service/exceptionVerification.go

@@ -0,0 +1,79 @@
+package service
+
+import (
+	. "api"
+	"config"
+	"fmt"
+	"github.com/go-xweb/xweb"
+	"log"
+	qutil "qfw/util"
+	"qfw/util/jy"
+	"qfw/util/redis"
+	"time"
+	"util"
+)
+
+type ExceptionVerification struct {
+	*xweb.Action
+	phoneVerification xweb.Mapper `xweb:"/exception/verification"` //虚拟网段手机号异常验证
+}
+
+func init() {
+	xweb.AddAction(&ExceptionVerification{})
+}
+
+const (
+	virtualPhoneFlag = "virtualIdentCode"
+	AbnormalTrigger  = "abnormal_trigger_%s"
+)
+
+func (this *ExceptionVerification) PhoneVerification() {
+	defer qutil.Catch()
+	userId, _ := this.GetSession("userId").(string)
+	reqType := this.GetString("reqType")
+	rData, errMsg := func() (interface{}, error) {
+		if userId == "" {
+			return nil, fmt.Errorf("未登录")
+		}
+		switch reqType {
+		case "sendIdentCode":
+			phone, _ := this.GetSession("phone").(string)
+			if phone == "" {
+				if res, _ := util.MQFW.FindById("user", userId, `{"s_phone":1,"s_m_phone":1}`); res != nil && len(*res) > 0 {
+					if resPhone := qutil.ObjToString((*res)["s_phone"]); resPhone != "" {
+						phone = resPhone
+					} else if resPhone := qutil.ObjToString((*res)["s_m_phone"]); resPhone != "" {
+						phone = resPhone
+					}
+				}
+			}
+			if phone == "" {
+				return nil, fmt.Errorf("未查询到手机号")
+			}
+			if !jy.SendPhoneIdentCode(config.Config.SmsServiceRpc, phone, this.Session(), virtualPhoneFlag) {
+				return nil, fmt.Errorf("验证码发送频繁")
+			}
+		case "codeVerification":
+			reqCode := this.GetString("reqCode")
+			if reqCode == "" {
+				return nil, fmt.Errorf("请输入验证码")
+			}
+			logTime := qutil.Int64All(this.Session().Get(fmt.Sprintf("%sTime", virtualPhoneFlag)))
+			if time.Now().Unix()-logTime > 60 {
+				return nil, fmt.Errorf("验证码超时")
+			}
+			if jy.CheckPhoneIdent(this.Session(), reqCode, virtualPhoneFlag) == "" {
+				return nil, fmt.Errorf("验证码校验失败")
+			}
+			jy.ClearPhoneIdentSession(this.Session(), virtualPhoneFlag)
+			redis.Del("newother", fmt.Sprintf(AbnormalTrigger, userId)) //验证成功清空redis
+		default:
+			return nil, fmt.Errorf("未知请求")
+		}
+		return true, nil
+	}()
+	if errMsg != nil {
+		log.Printf("%s ExceptionVerification PhoneVerification %s异常:%s\n", userId, reqType, errMsg.Error())
+	}
+	this.ServeJson(NewResult(rData, errMsg))
+}

+ 27 - 21
src/jfw/modules/subscribepay/src/service/phoneCollent.go

@@ -17,9 +17,9 @@ import (
 type PhoneCollent struct {
 	*xweb.Action
 	//合并 手机手机号
-	collectPhone xweb.Mapper `xweb:"/userMsg/collect"`     //收集手机号
-	neverRemind  xweb.Mapper `xweb:"/userMsg/neverRemind"` //不再提醒
-	needBind     xweb.Mapper `xweb:"/userMsg/needBind"`    //是否需要进入到绑定手机号
+	collectPhone xweb.Mapper `xweb:"/userMsg/collect"` //收集手机号
+	//neverRemind  xweb.Mapper `xweb:"/userMsg/neverRemind"` //不再提醒
+	needBind xweb.Mapper `xweb:"/userMsg/needBind"` //是否需要进入到绑定手机号
 }
 
 func (this *PhoneCollent) CollectPhone() {
@@ -54,30 +54,32 @@ func (this *PhoneCollent) CollectPhone() {
 	}()
 	this.ServeJson(NewResult(r, msg))
 }
-func (this *PhoneCollent) NeverRemind() {
-	if !R.CheckReqParam(this.ResponseWriter, this.Request, "merge_remind") {
-		return
-	}
-	userId := qutil.ObjToString(this.GetSession("userId"))
-	checkout, _ := this.GetBool("merge_remind")
-	if util.MQFW.UpdateById("user", userId, map[string]interface{}{
-		"$set": map[string]interface{}{
-			"b_merge_remind": checkout,
-		},
-	}) {
-		this.ServeJson(NewResult(map[string]interface{}{
-			"status": 1,
-		}, nil))
-	}
-	this.ServeJson(NewResult(nil, fmt.Errorf("保存失败")))
-}
+
+//func (this *PhoneCollent) NeverRemind() {
+//    if !R.CheckReqParam(this.ResponseWriter, this.Request, "merge_remind") {
+//        return
+//    }
+//    userId := qutil.ObjToString(this.GetSession("userId"))
+//    checkout, _ := this.GetBool("merge_remind")
+//    if util.MQFW.UpdateById("user", userId, map[string]interface{}{
+//        "$set": map[string]interface{}{
+//            "b_merge_remind": checkout,
+//        },
+//    }) {
+//        this.ServeJson(NewResult(map[string]interface{}{
+//            "status": 1,
+//        }, nil))
+//    }
+//    this.ServeJson(NewResult(nil, fmt.Errorf("保存失败")))
+//}
+
 func (this *PhoneCollent) NeedBind() {
 	r := func() bool {
 		uid, _ := this.GetSession("userId").(string)
 		if uid == "" {
 			return false
 		}
-		if person, ok := util.MQFW.FindById("user", uid, `{"s_phone":1,"s_m_phone":1,"b_merge_remind":1,"l_registedate":1}`); person != nil && len(*person) > 0 && ok {
+		if person, ok := util.MQFW.FindById("user", uid, `{"s_phone":1,"s_m_phone":1,"l_registedate":1}`); person != nil && len(*person) > 0 && ok {
 			s_phone := qutil.ObjToString((*person)["s_phone"])
 			if s_phone == "" {
 				s_phone = qutil.ObjToString((*person)["s_m_phone"])
@@ -89,10 +91,14 @@ func (this *PhoneCollent) NeedBind() {
 			reg := time.Unix(regtime, 0)
 			//新用户时间
 			accountMergeOnline := config.Config.AccountMergeOnline
+<<<<<<< HEAD
 			onLineTime, _ := time.ParseInLocation(Date_Full_Layout, accountMergeOnline, time.Local)
 			if remind, _ := (*person)["b_merge_remind"].(bool); remind { //不再提醒
 				return false
 			}
+=======
+			onLineTime, _ := time.ParseInLocation(qutil.Date_Full_Layout, accountMergeOnline, time.Local)
+>>>>>>> master
 			if onLineTime.Before(reg) { //新用户
 				return true
 			}

+ 312 - 0
src/web/staticres/common-module/account/js/verify.js

@@ -0,0 +1,312 @@
+var vNode = {
+  delimiters: ['${', '}'],
+  el: '#auth',
+  data: function (){
+      var _this = this;
+      return {
+          act: '',  // 是否要做某些操作
+          mode: '',  // 是否跳转强制绑定
+          from: '',  // 是否通过iframe进入
+          redirectTo: '',
+          info:{
+              phone: '',
+              email: ''
+          },
+          // 当前图形验证码信息
+          cur:{
+              showCaptcha: false,
+              imgSrc: ''
+          },
+          // 缓存起来的图形验证码信息
+          next:{
+              showCaptcha: false,
+              imgSrc: ''
+          },
+          pictureCode:'', // 图形验证码
+          msgCode:'', // 短信验证码
+          countdown: 0, // 倒计时
+          beforeTime: -1,
+          sendCodeBtn: true, // 显示发送短信按钮
+          nextStatus: [false, false],
+          pictureRules:[{
+              validator: function (val) {
+                  var status = /\d{4}/.test(val)
+                  _this.setNextStatus(status, 0)
+                  if (val === '') {
+                      return true
+                  }
+                  return status
+              },
+              message: '图形验证码格式错误'
+          }],
+          regCodeRules: [{
+              validator: function(val) {
+                  var status = /\d{6}/.test(val)
+                  _this.setNextStatus(status, 1)
+                  if (val === '') {
+                      return true
+                  }
+                  return status
+              },
+              message: '验证码格式错误'
+          }]
+      };
+  },
+  computed: {
+      btnStatus: function () {
+          if (!this.cur.showCaptcha) {
+              this.nextStatus[0] = true
+          }
+          return this.nextStatus.every(function(v) { return v} ) && (this.msgCode && this.msgCode.length === 6)
+      }
+  },
+  created () {
+      this.getUserInfo();
+      this.from = utils.getParam('from')
+      this.mode = utils.getParam('mode')
+      this.act = utils.getParam('act')
+      this.redirectTo = utils.getParam('redirectTo')
+      if (this.redirectTo) {
+        this.redirectTo = decodeURIComponent(this.redirectTo)
+      }
+  },
+  mounted() {
+      // this.getPicture()
+      // this.setHistory()
+      try {
+        JyObj.hiddenBottom('0')
+      } catch (e) {
+        console.warn(e)
+      }
+  },
+  methods: {
+      // 获取手机号
+      getUserInfo: function() {
+          var _this = this;
+          $.ajax({
+              url: "/jypay/user/getAccountInfo?t=" + Date.now(),
+              type: "GET",
+              success: function(res){
+                  if(res.error_code == 0){
+                      _this.info.phone = res.data.phone;
+                      _this.info.email = res.data.email;
+                  } else {
+                      _this.$toast(res.error_msg)
+                  }
+              }
+          });
+      },
+      // 加载loading
+      showLoading: function() {
+          var loading = this.$toast.loading({
+              duration: 0,
+              forbidClick: true,
+              message: 'loading...',
+          })
+          return loading
+      },
+      // 手机号截取
+      phoneFn: function(phone) {
+          phone = phone.replace(/(\d{3})\d{4}(\d{4})/, '$1 xxxx $2');
+          return phone;
+      },
+      setNextStatus:function (status, i) {
+          this.nextStatus.splice(i, 1, status)
+      },
+      // 图形验证码输入
+      inputPicture: function(val){
+          if (val === '') {
+              this.setNextStatus(false, 0)
+          } else {
+              this.setNextStatus(true, 0)
+          }
+      },
+      // 短信验证码输入
+      inputCode: function (val) { 
+          if (val === '') {
+              this.setNextStatus(false, 1)
+          } else {
+              this.setNextStatus(true, 1)
+          }
+      },
+      // 第一次出现图形验证码时获取图形验证码
+      getPicture: function (isCache) {
+          var _this = this;
+          if (_this.next.imgSrc) {
+              _this.cur.imgSrc = _this.next.imgSrc;
+              _this.cur.showCaptcha = _this.next.showCaptcha;
+              _this.next.imgSrc = ''
+              return;
+          }
+          $.ajax({
+              url: "/jypay/user/phone/imgCaptcha?t=" + Date.now(),
+              type: "GET",
+              success: function(res){
+                  if(res.error_code == 0 && res.data){
+                      if(res.data.needVerify) {
+                          // 如果需要显示图形验证码,则需要校验,也需要赋值图片地址
+                          _this.pictureCode ? _this.setNextStatus(true, 0) : _this.setNextStatus(false, 0)
+                      } else {
+                          // 如果不需要显示图形验证码,则无需校验,无需图片
+                          _this.setNextStatus(true, 0)
+                      }
+                      // 如果需要缓存图片
+                      if (isCache == 'cache') {
+                          // 将下一张图片的状态缓存
+                          _this.next.imgSrc = res.data.imageData
+                          _this.next.showCaptcha = res.data.needVerify
+                      } else {
+                          _this.cur.showCaptcha = res.data.needVerify;
+                          _this.cur.imgSrc = res.data.imageData
+                      }
+                  } else {
+                      _this.$toast(res.error_msg)
+                  }
+              }
+          });
+      },
+      // 改变图形验证码
+      refreshPicture: function(){
+          this.cur.imgSrc = '';
+          this.getPicture()
+      },
+      // 身份验证请求封装(1.发送验证码 、 2.验证身份)
+      validStatus: function(step,code,callback) {
+          // reqType: reqType==sendIdentCode发短信;reqType == codeVerification验证;reqCode: 图形验证码或短信验证码  callback:请求成功回调
+          var _this = this;
+          var data =  {
+              reqType: step,
+              reqCode: code
+          }
+          var loading = _this.showLoading();
+          $.ajax({
+              url: '/subscribepay/exception/verification',
+              type:'POST',
+              data: data,
+              success: function(res) {
+                  loading.clear()
+                  callback && callback(res)
+              }
+          })
+      },
+      // 发送短信验证码(第一次请求 reqType==sendIdentCode 传图形验证码)
+      sendMobileCode: function(){
+          // if(this.cur.showCaptcha && this.pictureCode == '') {
+          //     return;
+          // }
+          var tempRefs = this.$refs.phoneForm;
+          var _this = this;
+          var validArr = _this.cur.showCaptcha ? [tempRefs.validate('picture')] : []
+          Promise.all(validArr).then(function() {
+              _this.countdown = new Date().getTime()
+              // 发送手机验证码
+              _this.validStatus('sendIdentCode',_this.pictureCode,function(res){
+                if(res.error_code == 0 && res.data) {
+                    _this.sendCodeBtn = false
+                    _this.startTimer()
+                } else {
+                    _this.$toast(res.error_msg)
+                }
+            })
+          })
+      },
+      // 开始倒计时,倒计时结束将缓存的图片赋值并清空
+      startTimer: function() {
+          var _this = this;
+          _this.countdown = 60
+          _this.beforeTime = new Date().getTime()
+          var timeInt = setInterval(function() {
+              if (_this.beforeTime !== -1) {
+                  var nowCount = 60 - Math.ceil((new Date().getTime() - _this.beforeTime) / 1000)
+                  if (nowCount < _this.countdown) {
+                      _this.countdown = nowCount
+                  }
+              }
+              _this.countdown--
+              if (_this.countdown <= 0) {
+                  _this.sendCodeBtn = true
+                  _this.beforeTime = -1
+                  // _this.cur.imgSrc = _this.next.imgSrc;
+                  // _this.cur.showCaptcha = _this.next.showCaptcha;
+                  // _this.next.imgSrc = ''
+                  window.clearInterval(timeInt)
+              }
+          }, 1000)
+      },
+      // 提交验证(第二次请求:tep=codeVerification 传短信验证码)
+      submitForm: function () {
+          var _this = this;
+          var loading = _this.showLoading();
+          _this.validStatus('codeVerification',_this.msgCode,function(res){
+              if (res.error_code === 0 && res.data) {
+                  loading.clear();
+                  // 验证成功 返回上一页
+                  _this.afterSetPhoneSuccess()
+              } else {
+                  _this.$toast(res.error_msg);
+              }
+          })
+      },
+      // 手机号绑定或者更换成功后的操作
+      afterSetPhoneSuccess: function () {
+          var _this = this
+          _this.$toast({
+              message: '验证成功',
+              duration: 1500,
+              forbidClick: true,
+              onClose: function () {
+                  // 是否通过iframe打开
+                  if (_this.from == 'iframe') {
+                      window.parent.postMessage({
+                          action: 'success'
+                      }, location.origin)
+                  } else if (_this.act == 'logout') {
+                      try {
+                          JyObj.backUrl('H')
+                          JyObj.refreshAppointTab('subscribe', 1)
+                          JyObj.refreshAppointTab('box', 1)
+                          JyObj.refreshAppointTab('me', 1)
+                      } catch (error) {}
+                  } else if (_this.redirectTo) {
+                      location.replace(_this.redirectTo)
+                  } else {
+                      history.back()
+                  }
+              }
+          })
+      },
+      // 如果是强制绑定重定向过来的,返回时候就回到首页
+      setHistory: function () {
+        var _this = this
+        // act=logout,返回则退出登录,绑定成功则回到首页
+        if (this.act == 'logout') {
+            setTimeout(function () {
+                history.pushState({ act: _this.act }, '', '')
+                _this.onPopstate()
+            }, 300)
+        }
+      },
+      removePopstate: function () {
+          $(window).off('popstate')
+          $('.j-header .header-left').on('click', goBack)
+      },
+      onPopstate: function () {
+          $(window).on('popstate', function () {
+              try {
+                  appQuit(false)
+              } catch (error) {}
+          })
+      },
+      goBack: function () {
+          if(history.length === 1) {
+            try {
+              JyObj.backUrl('')
+            } catch (error) {}
+          } else {
+            history.back()
+          }
+          window.afterClickBack && window.afterClickBack()
+      }
+  }
+}
+var verify = new Vue(vNode)

+ 1 - 1
src/web/staticres/common-module/share/js/invite-friends.js

@@ -148,7 +148,7 @@ var shareContent = new Vue({
                         var userInfo = res
                         if (userInfo) {
                             if (!userInfo.headImage) {
-                                userInfo.headImage = '/images/auto.png'
+                                userInfo.headImage = '/common-module/public/image/auto.png'
                             }
                             Object.assign(_this.userInfo, userInfo)
                         }

BIN
src/web/staticres/commonFunctions/wm-team-reports.png


BIN
src/web/staticres/docs/aaaa.docx


BIN
src/web/staticres/docs/个人年终报告.docx


+ 7 - 0
src/web/staticres/frontRouter/pc/collection/css/index-pc.css

@@ -380,6 +380,13 @@
   box-sizing: content-box;
   min-width: 42px;
 }
+.body.in-iframe.in-bi {
+  background-color: transparent !important;
+}
+.in-bi .no-data {
+  padding-top: 100px;
+  margin-top: 0;
+}
 /* .bi-report-inject-button[disabled] {
   opacity: 0.6;
   cursor: not-allowed;

+ 1 - 1
src/web/templates/frontRouter/pc/brand/free/index.html

@@ -389,7 +389,7 @@
         <p class="name">服务热线</p>
         <img src="{{Msg "seo" "cdn"}}/brand/img/kefuQR.png?v={{Msg "seo" "version"}}" alt="" class="qr">
         <p class="phone">400-108-6670</p>
-        <p class="desc">8:50-18:00</p>
+        <p class="desc">工作日:9:00-17:40</p>
       </div>
       <div class="item">
         <p class="tit">市场合作</p>

+ 4 - 0
src/web/templates/frontRouter/pc/userMerge/sess/bind.html

@@ -14,6 +14,10 @@
   <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
 </head>
 <style>
+    html,
+    body.in-iframe{
+      background-color: #fff!important;
+    }
     .public-nav{
         border-bottom: 1px solid #e0e0e0;
     }

+ 353 - 0
src/web/templates/frontRouter/pc/userMerge/sess/verify.html

@@ -0,0 +1,353 @@
+<html>
+<head>
+    <title>账号异常验证</title>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
+    <meta name="renderer" content="webkit">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta content="light" theme="light" name="enable-header"/>
+    {{include "/common/pnc.html"}}
+    <link href="{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link href="{{Msg "seo" "cdn"}}/css/dev2/reset_pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
+  <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/pccss/public-nav.css?v={{Msg "seo" "version"}}" />
+  <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}" />
+  <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
+</head>
+<style>
+    html,
+    body.in-iframe{
+      background-color: #fff!important;
+    }
+    .public-nav{
+        border-bottom: 1px solid #e0e0e0;
+    }
+    .in-iframe .bind_page{
+        padding-top:0;
+    }.bind_page{
+        padding-top:76px;
+    }
+    .bind_page>.login-dig-phone-bind-box{
+        margin: 20px 0px 50px 0px;
+    }
+    .login-dig-phone-bind-box {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        font-family: Microsoft YaHei,sans-serif;
+        padding-bottom: 220px;
+    }
+
+    .login-dig-phone-bind-box .register-step-title {
+        font-size: 14px;
+        line-height: 24px;
+        color: #999999;
+    }
+
+    .login-dig-phone-bind-box .register-step-title div {
+        color: #1D1D1D;
+        font-size: 24px;
+        line-height: 36px;
+        text-align: left;
+        min-width: 340px;
+    }
+
+
+    .login-dig-phone-bind-box  .login-dig-input-box {
+        width: 340px;
+    }
+
+    .login-dig-phone-bind-box  button {
+        width: 340px;
+        margin-top: 32px;
+    }
+    .autocomplete-item {
+        position: relative;
+    }
+    .autocomplete-box {
+        display: none;
+        background: #fff;
+        position: absolute;
+        bottom: -213px;
+        left: 0;
+        width: 100%;
+        height: 205px;
+        max-height: 205px;
+        overflow: hidden;
+        overflow-y: auto;
+        z-index: 666;
+        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08);
+        border-radius: 8px;
+    }
+    .autocomplete-box li:hover {
+        background: #F6F6F6;
+    }
+    .autocomplete-box li:last-child {
+        border-bottom: none;
+    }
+    .autocomplete-box li {
+        width: 100%;
+        box-sizing: border-box;
+        color: #1D1D1D;
+        font-family: Microsoft YaHei,sans-serif;
+        font-size: 14px;
+        line-height: 24px;
+        letter-spacing: 0px;
+        text-align: left;
+        padding: 10px 20px;
+        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
+        cursor: pointer;
+    }
+    .login-dig-submit-button:disabled {
+        background: #87DFEA;
+        border-color: #87DFEA;
+    }
+
+    .bind-title-group {
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+    }
+    .bind-title-group p {
+        font-family: Microsoft YaHei,sans-serif;
+        font-style: normal;
+        font-weight: normal;
+        font-size: 14px;
+        line-height: 24px;
+        text-align: center;
+        color: #686868;
+    }
+    .bind-title-group div {
+        margin-top: 67px;
+        margin-bottom: 40px;
+        max-width: 1200px;
+        text-align: center;
+        font-family: Microsoft YaHei,sans-serif;
+        font-style: normal;
+        font-weight: normal;
+        font-size: 16px;
+        line-height: 40px;
+        color: #1D1D1D;
+        width: 100%;
+        border-bottom: 1px solid #EBEBEB;
+    }
+    .custom-toast .toast-container {
+      position: fixed;
+      top: 50%;
+      left: 50%;
+      width: auto;
+      padding: 16px 32px;
+      font-size: 16px;
+      background: rgba(0, 0, 0, 0.65);
+      border-radius: 8px;
+      color: #fff;
+      transform: translateX(-50%) translateY(-50%);
+      z-index: 99;
+    }
+    .custom-toast .mask{
+      position: fixed;
+      width: 100%;
+      height: 100%;
+      top: 0;
+      bottom: 0;
+      left: 0;
+      right: 0;
+      z-index: 98;
+      background: transparent;
+    }
+    .login-dig-success-toast{
+      margin-top: -140px!important;
+    }
+</style>
+<body>
+{{include "/common/pchead.html"}}
+<script>
+  $("div#bidLogin").remove()
+</script>
+<section class="bind_page" id="verify-account" v-cloak>
+    <div class="login-dig-tabbar-navbar"></div>
+    <div class="login-dig-success-toast" v-show="showSuccess">
+        <i class="login-dig-icon-success"></i>
+        <span>验证成功</span>
+    </div>
+    <div class="login-dig-phone-bind-box">
+        <div class="bind-title-group">
+            <div>账号异常验证</div>
+            <p>您好,系统识别到您的账号异常,请您对登录手机号进行验证。</p>
+        </div>
+        <div class="login-dig-tabbar-content is-active" data-name="code">
+            <div class="login-dig-input-box" style="background-color: transparent;border: 0;">
+                <i class="login-dig-icon-phone"></i>
+                <input v-model="formatVerifyPhone" autocomplete="off" disabled type="tel">
+            </div>
+            <div class="login-dig-input-box" :class="{'is-focus': codeFocus}" data-error="短信验证码输入错误">
+                <i class="login-dig-icon-guard"></i>
+                <input
+                  v-model="msgCode"
+                  @blur="onCodeBlur"
+                  @focus="onCodeFocus"
+                  autocomplete="off"
+                  name="verify_sms"
+                  type="text"
+                  placeholder="输入短信验证码"
+                  maxlength="6"
+                >
+                <div class="after-input-box">
+                    <span v-if="sendCodeBtn" class="l-get-sms" :class="formatVerifyPhone ? '' : 'is-stop'" @click="sendMobileCode">获取验证码</span>
+                    <span v-else class="l-get-sms is-stop">重新获取(${countdown}s)</span>
+                </div>
+            </div>
+            <button class="login-dig-submit-button" :disabled="verifyStatus" @click="submitForm">立即验证</button>
+        </div>
+    </div>
+</section>
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<script src="//cdn-common.jianyu360.com/cdn/lib/vue/2.6.14/vue.min.js"></script>
+<script type="text/javascript">
+  $(function(){
+    haslogin({{.T.logid}});
+
+    var verifyAccount = new Vue({
+      el: '#verify-account',
+      delimiters: ['${', '}'],
+      data: {
+        showSuccess: false,
+        verifyPhone: '',
+        codeFocus: false,
+        msgCode: '',
+        countdown: 0,
+        beforeTime: -1,
+        sendCodeBtn: true,
+      },
+      computed: {
+        formatVerifyPhone () {
+          return this.addConfusionForTel(this.verifyPhone)
+        },
+        verifyStatus () {
+          return !(this.msgCode && this.msgCode.length === 6)
+        }
+      },
+      created () {
+        this.getVerifyPhone()
+      },
+      mounted() {},
+      methods: {
+        // 手机号中间4位加*
+        addConfusionForTel: function (tel) {
+          var reg = /^(\d{3})\d{4}(\d{4})$/
+          return tel.replace(reg, '$1****$2')
+        },
+        getVerifyPhone: function () {
+          var _this = this
+          $.ajax({
+            url: '/jypay/user/getAccountInfo?t=' + Date.now(),
+            success: function (r) {
+              if (r && r.data) {
+                if (r.data.phone) {
+                  _this.verifyPhone = r.data.phone
+                }
+              }
+            }
+          })
+        },
+        // 验证请求封装(1.发送验证码 、 2.验证身份)
+        validStatus: function(type, code, callback) {
+          // reqType: reqType==sendIdentCode发短信;reqType == codeVerification验证;reqCode: 图形验证码或短信验证码  callback:请求成功回调
+          var _this = this;
+          var data =  {
+              reqType: type,
+              reqCode: code
+          }
+          $.ajax({
+              url: '/subscribepay/exception/verification',
+              type:'POST',
+              data: data,
+              success: function(res) {
+                callback && callback(res)
+              }
+          })
+        },
+        // 发送短信验证码(第一次请求 reqType==sendIdentCode 传图形验证码)
+        sendMobileCode: function() {
+            var _this = this;
+            _this.countdown = new Date().getTime()
+            // 发送手机验证码
+            _this.validStatus('sendIdentCode', '', function(res){
+              if(res.error_code === 0 && res.data) {
+                  _this.sendCodeBtn = false
+                  _this.startTimer()
+              } else {
+                  _this.toastFn(res.error_msg)
+              }
+          })
+        },
+        // 提交验证(第二次请求:tep=codeVerification 传短信验证码)
+        submitForm: function () {
+            if(!this.msgCode) return
+            var redirectTo = getParam('redirectTo')
+            var _this = this;
+            _this.validStatus('codeVerification', _this.msgCode,function(res){
+                if (res.error_code === 0 && res.data) {
+                  // 验证成功 返回上一页
+                  _this.showSuccess = true
+                  setTimeout(function () {
+                    _this.showSuccess = false
+                    // 非工作桌面重定向到传过来的上一页
+                    if (!goTemplateData.inIframe) {
+                      window.location.replace(redirectTo)
+                    } else {
+                      // 在工作桌面内跳转
+                      window.location.replace(redirectTo)
+                      // window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(redirectTo))
+                    }
+                  }, 1500)
+                } else {
+                  _this.toastFn(res.error_msg)
+                }
+            })
+        },
+        // 开始倒计时,倒计时结束将缓存的图片赋值并清空
+        startTimer: function() {
+            var _this = this;
+            _this.countdown = 60
+            _this.beforeTime = new Date().getTime()
+            var timeInt = setInterval(function() {
+                if (_this.beforeTime !== -1) {
+                    var nowCount = 60 - Math.ceil((new Date().getTime() - _this.beforeTime) / 1000)
+                    if (nowCount < _this.countdown) {
+                        _this.countdown = nowCount
+                    }
+                }
+                _this.countdown--
+                if (_this.countdown <= 0) {
+                    _this.sendCodeBtn = true
+                    _this.beforeTime = -1
+                    window.clearInterval(timeInt)
+                }
+            }, 1000)
+        },
+        onCodeFocus: function () {
+          this.codeFocus = true
+        },
+        onCodeBlur: function () {
+          this.codeFocus = false
+        },
+        toastFn: function (text, duration) {
+          if (!duration) {
+            duration = 2000
+          }
+          var _html = ""
+          _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
+          _html+='<span>' + text + '</span></div></div>'
+          $('body').append(_html)
+          setTimeout(function () {
+            $(".custom-toast").fadeOut().remove();
+          }, duration)
+        }
+      }
+    })
+  });
+</script>
+</body>
+</html>

+ 146 - 0
src/web/templates/frontRouter/wx/verify/free/index.html

@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="utf-8">
+    <meta name="keywords" content="剑鱼标讯">
+    <meta name="description" content="剑鱼标讯">
+    <meta name="author" content="剑鱼标讯">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
+    <meta name="browsermode" content="application">
+    <meta name="x5-orientation" content="portrait">
+    <meta name="screen-orientation" content="portrait">
+    <meta name="x5-page-mode" content="app">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <meta name="format-detection" content="telephone=no">
+    <title>账号异常验证</title>
+    <link rel="icon" href="/favicon.ico">
+    <script src="/js/rem.js"></script>
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href="/big-member/css/public.css?v={{Msg "seo" "version"}}" />
+    <link rel="stylesheet" href="/big-member/css/j-icons.css?v={{Msg "seo" "version"}}" />
+    <style>
+        .auth-tip {
+            padding: .48rem 0 .36rem;
+        }
+
+        .auth-tip p {
+            color: #9B9CA3;
+            font-size: .28rem;
+            line-height: .4rem;
+            text-align: center;
+        }
+
+        .auth-phone {
+            padding-bottom: .48rem;
+            color: #5F5E64;
+            font-size: .4rem;
+            line-height: .6rem;
+            text-align: center;
+            word-break: break-all;
+        }
+        .picture-code{
+            width: 90px;
+            height: 30px;
+            background: #F5F6F7;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+        .van-field__label {
+            font-size: .3rem;
+        }
+
+        .van-field__control {
+            font-size: .32rem;
+        }
+
+        .van-field--error .van-field__control,
+        .van-field--error .van-field__control::placeholder {
+            color: #171826;
+        }
+
+        .send_btn {
+            background-color: transparent;
+            color: #2ABED1;
+            border: 0;
+            font-size: .28rem;
+            height: unset;
+        }
+
+        .send_btn:disabled {
+            color: #9B9CA3;
+        }
+
+        .picture-cell {
+            padding: .28rem .32rem;
+        }
+
+        .code-cell {
+            padding: .32rem;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="j-container">
+        <div class="j-main" id="auth" v-cloak>
+            <div class="auth-tip">
+              <p>您好,系统识别到您的账号异常,</p>
+              <p>请您对登录手机号进行验证。</p>
+            </div>
+            <div class="auth-phone">${phoneFn(info.phone)}</div>
+            <div class="auth-form">
+                <van-form ref="phoneForm" @submit="submitForm">
+                    <van-field
+                        v-if="cur.showCaptcha"
+                        center
+                        class="picture-cell"
+                        v-model.trim="pictureCode"
+                        type="number"
+                        name="picture"
+                        placeholder="图形验证码"
+                        :rules="pictureRules"
+                        @input="inputPicture(pictureCode)"
+                    >
+                        <template #button>
+                            <div class="picture-code">
+                                <img v-if="cur.imgSrc" :src="'data:image/png;base64,' + cur.imgSrc" alt="图形验证码" width="90" height="30" @click="refreshPicture" key="picCode" />
+                                <van-loading size="24" v-else key="picCode"></van-loading>
+                            </div>
+                        </template>
+                    </van-field>
+                    <van-field
+                        center
+                        class="code-cell"
+                        v-model.trim="msgCode"
+                        type="number"
+                        name="code"
+                        label="验证码"
+                        placeholder="请输入验证码"
+                        :rules="regCodeRules"
+                        @input="inputCode(msgCode)"
+                    >
+                        <template #button>
+                            <van-button native-type="button" v-show="sendCodeBtn" class="send_btn" slot="button"  size="small" @click="sendMobileCode" type="button">发送验证码</van-button>
+                            <van-button native-type="button" v-show="!sendCodeBtn" class="send_btn gray" slot="button" size="small" disabled type="button">重新发送(${countdown}s)</van-button>
+                        </template>
+                    </van-field>
+                    <div class="j-footer j-button-group" style="background-color: transparent;padding: .64rem .32rem;">
+                        <button class="j-button-confirm" native-type="submit" :disabled="!btnStatus">立即验证</button>
+                    </div>
+                </van-form>
+            </div>
+        </div>
+    </div>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+    <script src='/big-member/js/utils.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Msg "seo" "cdn"}}/common-module/account/js/verify.js?v={{Msg "seo" "version"}}'></script>
+</body>
+{{include "/common/baiducc.html"}}
+</html>

Some files were not shown because too many files changed in this diff