Răsfoiți Sursa

fix:限制用户登录修改

duxin 2 ani în urmă
părinte
comite
5105088cba

+ 1 - 1
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -141,7 +141,7 @@ func NoLoginAssociatedInfo(entId string) []map[string]interface{} {
 // int -1无权限 1免费权限 2超级订阅次数&采购单位流量包 3使用体验
 func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, isWinner bool, session *httpsession.Session) (*Portrait, int, error, bool) {
 	if userid == "" {
-		if pageFlag == "entPortrait" || pageFlag == "entDetail" { //未登录用户获取基本信息 与基础分析信息
+		if pageFlag == "entDetail" { //未登录用户获取基本信息 与基础分析信息
 			return &Portrait{userid, session}, 1, nil, true
 		}
 		return nil, -1, errors.New("未登录"), true

+ 1 - 3
src/jfw/modules/bigmember/src/filter/sessionfilter.go

@@ -51,9 +51,7 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		return true
 	}
 	//企业画像部分免费功能接口开放
-	if strings.Contains(req.URL.Path, "/bigmember/portrait/subVipPortrait/winner") || //分析接口
-		strings.Contains(req.URL.Path, "/bigmember/portrait/subVipPortrait/entDetail") { //超级订阅页面基本信息接口
-		//strings.Contains(req.URL.Path, "/bigmember/portrait/winner/getNewMsg") { //项目动态
+	if strings.Contains(req.URL.Path, "/bigmember/portrait/subVipPortrait/entDetail") { //超级订阅页面基本信息接口
 		return true
 	}
 	bigMeg := jy.GetBigVipUserBaseMsg(session, *config.Middleground)

+ 6 - 0
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -332,6 +332,9 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 		if buyer == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
+		if userId == "" {
+			return nil, fmt.Errorf("未登录")
+		}
 		pageNum, _ := this.GetInteger("pageNum")
 		pageSize, _ := this.GetInteger("pageSize")
 		cepm, power, err, _ := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyer, false, this.Session())
@@ -451,6 +454,9 @@ func (this *SubVipPortrait) BuyerPortrait() {
 		if buyerName == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
+		if userId == "" {
+			return nil, fmt.Errorf("未登录")
+		}
 		cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
 		cepm.Session = this.Session()
 		if err != nil {