Browse Source

feat:路由拦截

wangchuanjin 3 years ago
parent
commit
c8fd37302c

+ 2 - 1
src/config.json

@@ -55,7 +55,8 @@
 		"memberreport_experience":"/bigmember/report/openpushmsg?t=wx_experience&start=%s&end=%s&pushcount=%s&advertcode=%s",
 		"chanpartner":"/weixin/frontPage/partner/sess/partner?p=wxmeun",
 		"datareport":"/datareport/page/order/detail/%s?advertcode=%s",
-		"vipFree7":"/weixin/frontPage/share/sess/index?p=wxmeun"
+		"vipFree7":"/weixin/frontPage/share/sess/index?p=wxmeun",
+		"toSubVipSetPage":"/front/vipsubscribe/toSubVipSetPage?advertcode=%s"
     },
     "jy_activeset": {
         "activitystartcode": "3201000000",

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

@@ -132,11 +132,16 @@ func (s *Subscribepay) ToSetInfoTypePage() {
 }
 
 //订阅设置
-func (s *Subscribepay) ToSetPage() {
+func (s *Subscribepay) ToSetPage() error {
 	userid := util.ObjToString(s.GetSession("userId"))
 	vipMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
 	if vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
-		s.Redirect("/front/tenderSubscribe/guide")
+		return s.Redirect("/front/tenderSubscribe/guide")
+	} else if vipMsg.VipStatus <= 0 && !vipMsg.IsUpgrade {
+		if s.GetString("advertcode") != "" {
+			return s.Redirect("/wxkeyset/keyset/index?advertcode=" + s.GetString("advertcode"))
+		}
+		return s.Redirect("/wxkeyset/keyset/index")
 	}
 	nowTime := time.Now().Unix()
 	if nowTime >= liveActiveStartTime && nowTime < liveActiveEndTime {
@@ -152,7 +157,7 @@ func (s *Subscribepay) ToSetPage() {
 	s.T["avatar"] = myavatar
 	s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
 	s.T["openid"] = se.EncodeString(myopenid)
-	s.Render("/weixin/vipsubscribe/vip_index_new.html")
+	return s.Render("/weixin/vipsubscribe/vip_index_new.html")
 }
 
 func (s *Subscribepay) ToSetPageOld() {

+ 1 - 1
src/jfw/front/wxkeyset.go

@@ -36,7 +36,7 @@ func (m *Front) WxKeyset(tpl string) error {
 		return m.Redirect("/front/tenderSubscribe/guide")
 	}
 	//到新订阅设置
-	if vipMsg.IsUpgrade {
+	if vipMsg.VipStatus > 0 || vipMsg.IsUpgrade {
 		return m.Redirect("/front/vipsubscribe/toSubVipSetPage")
 	}
 	if tpl == "seniorset" {

+ 3 - 0
src/jfw/modules/app/src/app/front/vipsubscribe.go

@@ -111,6 +111,9 @@ func (s *Subscribepay) ToSetPage() {
 	}
 	vSwitch = jy.SwitchService.Get(s.Session(), public.MQFW) //v:vip m:member
 	bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
+	if (vSwitch == "" || vSwitch == "v") && bigBaseMsg.VipStatus <= 0 && !bigBaseMsg.IsUpgrade {
+		s.Redirect("/jyapp/wxkeyset/keyset/index")
+	}
 	//如果没有首次使用
 	if vSwitch == "m" && bigBaseMsg.Status > 0 && !bigBaseMsg.Used {
 		s.Redirect("/jyapp/big/page/init") //跳转至首次初始化页面

+ 3 - 3
src/jfw/modules/app/src/config.json

@@ -17,7 +17,7 @@
 		"vipreport": "/subscribepay/report/wxtplmsg?start=%s&end=%s&pushcount=%s",
 		"entnichehistorypush": "/jyapp/entniche/pushlist?selectTime=%s&pi=%s&pn=%s&type=%s",
 		"trackReport": "/page_entniche/business/t-report/detail/%s_%s/%s",
-		"viphomepage": "/jyapp/vipsubscribe/toSubVipSetPage",
+		"viphomepage": "/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=%s",
 		"pushFollowEnt": "/jyapp/big/page/ent_follow",
 		"pushFollowProject": "/jyapp/big/page/pro_follow_list",
 		"pushMember": "/jyapp/big/page/big_subscribe?pushtime=%s",
@@ -110,7 +110,7 @@
 		"shareTimesUpperLimitR": 4000,
 		"shareTimesUpperLimitIrr": 1000
 	},
-	"appPushServiceRpc": "192.168.20.139:5566",
+	"appPushServiceRpc": "192.168.20.114:5566",
 	"afterSavePushId": 60,
 	"mail": [
     {
@@ -146,7 +146,7 @@
 	"termValidity": 3600,
 	"uploadPath": "./web/staticres/jyapp/res/",
 	"appConfig":{
-		"pushGrpcServer":"192.168.20.139:5565",
+		"pushGrpcServer":"192.168.20.114:5565",
 		"pushGrpcHeartBeat":3
 	},
     "redisSessionLockSize":20,

+ 6 - 6
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -133,13 +133,13 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 			}
 		}
 		//免费用户画像和附件下载权限
-		if userPower.Status <= 0 && userPower.VipStatus <= 0 {
-			o_jy := qutil.ObjToMap((*data)["o_jy"])
-			//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
-			if qutil.IntAll((*o_jy)["i_newfree"]) > 0 {
-				userPower.IsUpgrade = true
-			}
+		//if userPower.Status <= 0 && userPower.VipStatus <= 0 {
+		o_jy := qutil.ObjToMap((*data)["o_jy"])
+		//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+		if qutil.IntAll((*o_jy)["i_newfree"]) > 0 {
+			userPower.IsUpgrade = true
 		}
+		//}
 	}
 	entniche := 0
 	res := mysql.SelectBySql(`SELECT i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i