Эх сурвалжийг харах

Merge branch 'dev/v4.8.36_dx' of qmx/jy into feature/v4.8.36

duxin 2 жил өмнө
parent
commit
cf2a91e7aa

+ 4 - 0
src/jfw/filter/pcfilter.go

@@ -37,6 +37,10 @@ func (this *pcFilter) Do() bool {
 		//wx
 		return true
 	}
+	//企业搜索
+	if strings.Contains(this.R.RequestURI, "/jylab/entSearch/index.html") || strings.Contains(this.R.RequestURI, "/swordfish/page_big_pc/ent_portrait/") {
+		return true
+	}
 	//pc助手订阅消息、招标搜索两个菜单链接过滤掉
 	if strings.HasPrefix(this.R.RequestURI, "/jypc/toAct/") || strings.Contains(this.R.RequestURI, "/exhibition/") {
 		return true

+ 0 - 1
src/jfw/front/classificationTag.go

@@ -35,7 +35,6 @@ type KeyType struct {
 func RegionAndInformationAndTender() map[string]interface{} {
 	if bytes, err := redis.GetBytes(RedisNameNew, "regionAndInformationAndTender"); err == nil && bytes != nil {
 		rData := map[string]interface{}{}
-		log.Println()
 		if err := json.Unmarshal(*bytes, &rData); err != nil {
 			log.Printf("[MANAGER-ERR]RegionAndInformationAndTender  GetData Error %v \n", err)
 			return nil

+ 10 - 0
src/jfw/front/entsearch.go

@@ -37,6 +37,16 @@ func (e *Entsearch) EntSearchIndex() error {
 	if len(shareid) == 0 {
 		shareid = "10"
 	}
+	e.T["isLogin"] = 0
+	if userId, _ := e.GetSession("userId").(string); userId != "" {
+		userInfo := jy.GetVipState(e.Session(), *config.Middleground, userId)
+		e.T["isVip"] = userInfo.VipState > 0
+		e.T["isMember"] = userInfo.BigMember > 0
+		e.T["isEntniche"] = userInfo.EntMember > 0
+		e.T["isEntnicheNew"] = userInfo.IsNewEnt
+		e.T["isEntService"] = userInfo.EntService
+		e.T["isLogin"] = 1
+	}
 	e.T["shareid"] = se.EncodeString(shareid)
 	e.T["searchvalue"] = e.GetString("searchvalue")
 	e.T["logid"] = config.Seoconfig["jyzbqyss"].(string)

+ 5 - 7
src/jfw/front/frontRouter.go

@@ -1,15 +1,13 @@
 package front
 
 import (
+	"app.yhyue.com/moapp/jypkg/public"
 	"fmt"
 	"jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
 	"jy/src/jfw/wx"
 	"net/url"
 	"regexp"
-	"strings"
-
-	"app.yhyue.com/moapp/jypkg/public"
 
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 
@@ -213,11 +211,11 @@ var bigVipFreePageReg = regexp.MustCompile(`set_.*|free|unit_portrayal|analysis_
 // 工作桌面需求 不需要判断用户权限
 func (this *CommonRouter) doPcBigPage(pageSign, types string) error {
 	//page := pageSign
-	userid, _ := this.GetSession("userId").(string)
+	//userid, _ := this.GetSession("userId").(string)
 	//没有登录跳转登录页面(采购单位画像除外)
-	if !strings.Contains(pageSign, "unit_portrayal") && userid == "" {
-		return this.Redirect("/notin/page")
-	}
+	//if !strings.Contains(pageSign, "unit_portrayal") && userid == "" {
+	//	return this.Redirect("/notin/page")
+	//}
 	return this.Render(fmt.Sprintf("/frontRouter/pc/page_big_pc/sess/index.html"))
 }
 

+ 46 - 40
src/jfw/modules/bigmember/src/filter/sessionfilter.go

@@ -1,57 +1,63 @@
 package filter
 
 import (
-    "jy/src/jfw/modules/bigmember/src/config"
-    "jy/src/jfw/modules/bigmember/src/db"
-    "net/http"
-    "regexp"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
+	"net/http"
+	"regexp"
 
-    . "app.yhyue.com/moapp/jybase/api"
-    util "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	. "app.yhyue.com/moapp/jybase/api"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 
-    "app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
 
-//登录限制
+// 登录限制
 type sessionfilter struct {
-    App *xweb.App
+	App *xweb.App
 }
 
-//需要权限判断的地址
+// 需要权限判断的地址
 var needReg = regexp.MustCompile("^/bigmember/(potential|forecast|decision|analysis|subscribe)/.+$") //画像接口中判断权限
 
 func init() {
-    jy.InitBigVipService(db.Mysql)
+	jy.InitBigVipService(db.Mysql)
 }
 
 func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
-    session := l.App.SessionManager.Session(req, w)
-    getSession := session.GetMultiple()
-    if getSession["userId"] != nil && getSession["mgoUserId"] == nil && util.Int64All(getSession["positionType"]) == 0 {
-        session.Set("mgoUserId", getSession["userId"])
-    }
-    match := needReg.FindStringSubmatch(req.URL.Path)
-    if len(match) == 0 {
-        return true
-    }
-    //免费用户搜索词订阅接口开放
-    if req.URL.Path == "/bigmember/subscribe/freeUser/searchSubscribe" || req.URL.Path == "/bigmember/subscribe/freeUser/subscribeSearch" {
-        return true
-    }
-    userId, ok := getSession["userId"].(string)
-    if !ok || userId == "" {
-        R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
-        return false
-    }
-    //投标决策分析前置接口开放
-    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(session, *config.Middleground)
-    if !bigMeg.CheckBigVipBackPower(match[1]) {
-        R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
-        return false
-    }
-    return true
+	session := l.App.SessionManager.Session(req, w)
+	getSession := session.GetMultiple()
+	if getSession["userId"] != nil && getSession["mgoUserId"] == nil && util.Int64All(getSession["positionType"]) == 0 {
+		session.Set("mgoUserId", getSession["userId"])
+	}
+	match := needReg.FindStringSubmatch(req.URL.Path)
+	if len(match) == 0 {
+		return true
+	}
+	//免费用户搜索词订阅接口开放
+	if req.URL.Path == "/bigmember/subscribe/freeUser/searchSubscribe" || req.URL.Path == "/bigmember/subscribe/freeUser/subscribeSearch" {
+		return true
+	}
+	userId, ok := getSession["userId"].(string)
+	if !ok || userId == "" {
+		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
+		return false
+	}
+	//投标决策分析前置接口开放
+	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
+	}
+	//企业画像部分免费功能接口开放
+	if req.URL.Path == "/bigmember/portrait/winner/getData" || //分析接口
+		req.URL.Path == "/bigmember/portrait/ent/detail" || //基本信息接口
+		req.URL.Path == "/bigmember/portrait/winner/getNewMsg" { //项目动态
+		return true
+	}
+	bigMeg := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
+	if !bigMeg.CheckBigVipBackPower(match[1]) {
+		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
+		return false
+	}
+	return true
 }

+ 3 - 2
src/jfw/modules/publicapply/src/filter/sessionfilter.go

@@ -12,7 +12,7 @@ import (
 	"app.yhyue.com/moapp/jypkg/identity"
 )
 
-//登录限制
+// 登录限制
 type sessionfilter struct {
 	App *xweb.App
 }
@@ -21,6 +21,7 @@ var reg = regexp.MustCompile("^/publicapply/free/.*")
 var reg_share = regexp.MustCompile("^/publicapply/shareFission/.*")
 var reg_nps = regexp.MustCompile("^/publicapply/nps/.*")
 var regWhiteList = regexp.MustCompile("^/publicapply/userbase/whitelist$")
+var regEntSearch = regexp.MustCompile("^/publicapply/enterpriseSearch/doQuery") //企业搜索接口
 
 func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	session := l.App.SessionManager.Session(req, w)
@@ -31,7 +32,7 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
 		identity.SwitchToBest(util.Int64All(getSession["base_user_id"]), session, Middleground, &Mgo, false)
 	}
-	if reg.MatchString(req.URL.Path) || reg.MatchString(req.URL.Path) || reg_share.MatchString(req.URL.Path) || reg_nps.MatchString(req.URL.Path) {
+	if regEntSearch.MatchString(req.URL.Path) || reg.MatchString(req.URL.Path) || reg.MatchString(req.URL.Path) || reg_share.MatchString(req.URL.Path) || reg_nps.MatchString(req.URL.Path) {
 		return true
 	}
 	if regWhiteList.MatchString(req.URL.Path) { // 判断用户是不是白名单接口不拦截