Quellcode durchsuchen

Merge branch 'master' into feature/v4.9.10

lianbingjie vor 1 Jahr
Ursprung
Commit
d3213bf329

+ 1 - 1
src/go.mod

@@ -6,7 +6,7 @@ require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230308011651-df591d32df88
 	app.yhyue.com/moapp/jybase v0.0.0-20240104022202-158734833402
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.14.7
+	app.yhyue.com/moapp/jypkg v1.14.8
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.16
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/bwmarrin/snowflake v0.3.0

+ 2 - 3
src/go.sum

@@ -1,4 +1,3 @@
-
 app.yhyue.com/moapp/MessageCenter v0.0.0-20230918064638-5cd2498053ae/go.mod h1:SJsuvb720yzCajIfwtVNPKT6y4OiIqD3cOXJgOLZ52Q=
 app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d h1:WPsYuuptAd3UEgN+jPzpnsDe/OvcshDUUtOTZPYGSJ8=
 app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d/go.mod h1:91/lSD/hS+ckMVP3WdidRzDhC60lLMdyce9QHy0cSMA=
@@ -21,8 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20240104022202-158734833402/go.mod h1:fjaD11Z3
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v1.14.7 h1:X8/6LO59ZpzS/FhxKR3m9avO6zbq+KV1lwhowqGhQ7k=
-app.yhyue.com/moapp/jypkg v1.14.7/go.mod h1:uGSHEjlIVCDFeud5hD7bY5Z1Csrvh+c3vr4Mg50qCW0=
+app.yhyue.com/moapp/jypkg v1.14.8 h1:jWQUPuTYrTFJnr7rDOUJInHTKVXbtNvDjNipfJ6O3kQ=
+app.yhyue.com/moapp/jypkg v1.14.8/go.mod h1:ZdrY5aTfeb2HrgLGKyNIETiHS28DNclpGGBSUpdOrx8=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 8 - 6
src/jfw/front/hybg.go

@@ -129,17 +129,19 @@ func (l *DeskAnalysisReport) DeskReport() {
 		if len(areas) == 0 {
 			userData := jy.GetBigVipUserBaseMsg(l.Session(), *config.Middleground)
 			oArea := &map[string]interface{}{}
-			if userData.Data.Member.Status > 0 {
+			if userData.Status > 0 {
 				types = "m"
-			} else if userData.Data.Vip.Status > 0 {
+			} else if userData.VipStatus > 0 {
 				types = "v"
 			} else if userData.EntnicheStatus == 1 {
 				types = "s"
 			}
 			vipJy := jy.GetSubScribeInfo(l.Session(), mongodb, types, "10000")
-			oArea = qutil.ObjToMap((*vipJy)["o_area"])
-			for key := range *oArea {
-				areas = append(areas, key)
+			if vipJy != nil {
+				oArea = qutil.ObjToMap((*vipJy)["o_area"])
+				for key := range *oArea {
+					areas = append(areas, key)
+				}
 			}
 		}
 
@@ -155,7 +157,7 @@ func (l *DeskAnalysisReport) DeskReport() {
 		}
 		log.Printf("用户userId:%s,mgoid:%s,types:%s,sql:%s\n", userId, mgoUserId, types, strSql)
 		var dataArrMap []map[string]interface{}
-		reportRes, _ := g.DB().Query(gctx.New(), fmt.Sprintf(`SELECT * FROM analysis_report %s ORDER BY show_time DESC,classify desc LIMIT 10
+		reportRes, _ := g.DB().Query(gctx.New(), fmt.Sprintf(`SELECT * FROM analysis_report %s ORDER BY show_time DESC,classify desc,id desc  LIMIT 10
 `, strSql))
 		if !reportRes.IsEmpty() {
 			for _, row := range reportRes.List() {

+ 1 - 0
src/jfw/modules/app/src/app/filter/loginfilter.go

@@ -36,6 +36,7 @@ var urls = []*regexp.Regexp{
 	regexp.MustCompile("^/jySite/.*"),
 	regexp.MustCompile("^/jyapp/initialize/whiteList"),
 	regexp.MustCompile("^/jyapp/transit/.*"),
+	regexp.MustCompile("^/jyapp/new/.*"),
 }
 
 type loginFilter struct {

+ 32 - 7
src/jfw/modules/app/src/app/front/login.go

@@ -230,10 +230,15 @@ func (l *Login) Login() error {
 						"s_platform": "app",
 						"s_sourceid": channelCode,
 					}
-					// 新用户注册 记录活动来源
-					activity := l.GetString("activity")
-					if activity != "" {
-						data["s_rsource"] = activity
+					// 新用户注册 记录来源
+					sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+					if sourceLabel != "" {
+						data["s_rsource"] = sourceLabel
+					} else {
+						activity := l.GetString("activity")
+						if activity != "" {
+							data["s_rsource"] = activity
+						}
 					}
 					//注册邮箱
 					email := l.GetString("email")
@@ -241,7 +246,6 @@ func (l *Login) Login() error {
 						data["s_email"] = email
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
-
 					if resp := config.Middleground.UserCenter.UserAdd(pb.UserAddReq{
 						Appid: "10000",
 						Phone: phone,
@@ -253,8 +257,12 @@ func (l *Login) Login() error {
 					}
 					_id := mongodb.Save("user", data)
 					if _id != "" {
+						if sourceLabel != "" {
+							go func() {
+								redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+							}()
+						}
 						userInfo["isNewUser"] = true
-
 						jy.ClearPhoneIdentSession(l.Session())
 						returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
 						if disWord != "" {
@@ -573,10 +581,13 @@ func (l *Login) Register() error {
 					"s_company":     s_entname,
 					"s_sourceid":    channelCode,
 				}
+				sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+				if sourceLabel != "" {
+					data["s_rsource"] = sourceLabel
+				}
 				email := l.GetString("email")
 				registerclient := jy.NewRegister(jyutil.Compatible.Mgo, jyutil.Compatible.BaseService, jyutil.Compatible.MainMysql, jyutil.Compatible.Middleground)
 				_, errStr = registerclient.PublicRegister(phone, email, isAndroidOrIOS(l.Header("User-Agent")), data, func(saveid string) {
-
 					go func() {
 						if disWord != "" {
 							redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
@@ -611,6 +622,11 @@ func (l *Login) Register() error {
 					})
 				})
 				if errStr == "y" {
+					if sourceLabel != "" {
+						go func() {
+							redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+						}()
+					}
 					returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
 					//剑鱼币
 					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", qutil.ObjToString(l.GetSession("mgoUserId")), jy.Jyapp_node1, map[string]interface{}{
@@ -772,6 +788,10 @@ func (l *Login) WxLogin() {
 				"s_jyname":   jy.GetUserName("newother", config.Sysconfig["namePrefix"].(string)), //剑鱼昵称
 				"s_sourceid": channelCode,
 			}
+			sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+			if sourceLabel != "" {
+				newUser["s_rsource"] = sourceLabel
+			}
 			//注册邮箱
 			email := l.GetString("email")
 			if jy.IsEmail(email) {
@@ -793,6 +813,11 @@ func (l *Login) WxLogin() {
 			}
 
 			if _id := mongodb.Save("user", newUser); _id != "" {
+				if sourceLabel != "" {
+					go func() {
+						redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+					}()
+				}
 				returnSign = afterLogin(newUser, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
 				if disWord != "" {
 					redisDis := redis.GetStr("other", "DIS_"+disWord[1:])

+ 34 - 0
src/jfw/modules/app/src/app/front/wx.go

@@ -0,0 +1,34 @@
+package front
+
+import (
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"fmt"
+	"log"
+)
+
+// 基于统计流量数据以及用户信息收录,新公众号:剑鱼标讯网,新建首页地址
+var (
+	cacheTimeOut = 3 * 24 * 60 * 60 //三天
+)
+
+type WX struct {
+	*xweb.Action
+	index xweb.Mapper `xweb:"/jyapp/new/(.*)"`
+}
+
+func init() {
+	xweb.AddAction(&WX{})
+}
+
+// 微信首页地址
+func (w *WX) Index(pageLabel string) error {
+	log.Println("---sessionId----:", w.Session().Id())
+	//未登录
+	if userId, _ := w.GetSession("userId").(string); userId == "" {
+		redis.Put("limitation", fmt.Sprintf("firstVisitTagByWX_%s", w.Session().Id()), pageLabel, cacheTimeOut) //app 登录注册 用户标识
+		return w.Redirect("/jyapp/jylab/mainSearch")
+	}
+	//已登录
+	return w.Redirect("/jy_mobile/tabbar/home")
+}

+ 2 - 0
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/utils.js

@@ -101,6 +101,8 @@ var utils = {
     // utils版本号
     version: '0.0.3',
     isWeiXinBrowser: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1,
+    isH5: window.location.href.toLowerCase().indexOf('h5') !== -1,
+    isApp: window.location.href.toLowerCase().indexOf('app') !== -1,
     isAndroid: navigator.userAgent.toLowerCase().indexOf('android') !== -1,
     isIos: /iphone|ipod|ipad|ios/.test(navigator.userAgent.toLowerCase()),
     // 传入你要获取的参数的名字

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_pro_follow_detail.html

@@ -1453,7 +1453,7 @@
             },
             // 项目公告跳转到三级页
             getDetail: function (sid) {
-                if (utils.isWeiXinBrowser) {
+                if (utils.isWeiXinBrowser&&window.location.href.indexOf("/jyapp/")<0) {
                     location.href = '/article/content/' + sid + '.html'
                 } else {
                     location.href = '/jyapp/article/content/' + sid + '.html'

+ 1 - 1
src/jfw/modules/publicapply/src/db.json

@@ -45,7 +45,7 @@
   },
   "redis": {
     "main":{
-      "address": "other=192.168.3.149:1712,session=192.168.3.149:1713,newother=192.168.3.149:1712,poly=192.168.3.149:1713"
+      "address": "other=192.168.3.149:1712,session=192.168.3.149:1713,newother=192.168.3.149:1712,poly=192.168.3.149:1713,limitation=192.168.3.149:1713"
     }
   },
   "mysql": {

+ 11 - 2
src/jfw/modules/publicapply/src/oneclick/entity/entity.go

@@ -151,8 +151,8 @@ func (o *OneClickInfo) GetPhoneByToken() (map[string]interface{}, error) {
 		return nil, err
 	}
 	// 手机号登录注册及绑定操作
-	data, err := o.ProcessPhone(phone)
-	return data, err
+	//data, err := o.ProcessPhone(phone)
+	return o.ProcessPhone(phone)
 }
 
 /**
@@ -362,6 +362,10 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 				"s_platform": platform,
 				"s_sourceid": channelCode,
 			}
+			sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", o.Session.Id()))
+			if sourceLabel != "" {
+				data["s_rsource"] = sourceLabel
+			}
 			// 新注册用户
 			if o.Activity != "" {
 				data["s_rsource"] = o.Activity
@@ -369,6 +373,11 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 			data["s_regsource"] = isAndroidOrIOS(client)
 			_id := db.Mgo.Save("user", data)
 			if _id != "" {
+				if sourceLabel != "" {
+					go func() {
+						redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", o.Session.Id()))
+					}()
+				}
 				userInfo["isNewUser"] = true
 				//用户中台同步
 				func(userid string) {

+ 3 - 1
src/web/staticres/common-module/collection/js/analysis-report-example.js

@@ -204,7 +204,9 @@ var chartExample = {
       <div><span class="on">升级超级订阅:</span><span>适合需要订阅更多省份、查看更多采购单位画像及企业画像的用户。</span></div><div style="margin-top:20px"><span class="on">充值画像包:</span><span>适合仅需要查看更多采购单位画像用户。</span></div>
       `
       var isWeixin = utils.isWeiXinBrowser
-      if(!isWeixin) {
+      var isH5 = utils.isH5
+      var isApp = utils.isApp
+      if(!isWeixin|| isH5 || isApp) {
         if (this.getTextMap.btnText == '立即解锁') {
           // 留资
           location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + source

+ 3 - 1
src/web/staticres/common-module/collection/js/buyer-example.js

@@ -250,7 +250,9 @@ var buyerExample = {
       <div><span class="on">升级超级订阅:</span><span>适合需要订阅更多省份、查看更多采购单位画像及企业画像的用户。</span></div><div style="margin-top:20px"><span class="on">充值画像包:</span><span>适合仅需要查看更多采购单位画像用户。</span></div>
       `
       var isWeixin = utils.isWeiXinBrowser
-      if(!isWeixin) {
+      var isH5 = utils.isH5
+      var isApp = utils.isApp
+      if(!isWeixin|| isH5 || isApp) {
         if (this.getTextMap.btnText == '立即解锁') {
           // 留资
           location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + source

+ 3 - 1
src/web/staticres/common-module/collection/js/vip-dialog.js

@@ -343,7 +343,9 @@ var vipComponent = {
       // 点击按钮保存tabActiveName值
       this.$emit('tabactive', 'save')
       const isWeixin = utils.isWeiXinBrowser
-      if (isWeixin) {
+      const isH5 = utils.isH5
+      const isApp = utils.isApp
+      if (isWeixin&&!isH5&&!isApp) {
         this.goOpenOfWx(this.getTextMap.btnText, source)
       } else {
         this.goOpenOfApp(this.getTextMap.btnText, source)

+ 3 - 1
src/web/staticres/common-module/exhibition/js/index.js

@@ -43,7 +43,9 @@ $(function () {
 function go_kf () {
   var isWeiXinBrowser =
     navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
-  window.location.href = isWeiXinBrowser
+  var isH5 = window.location.href.indexOf('h5')!==-1
+  var isApp = window.location.href.indexOf('app')!==-1
+  window.location.href = isWeiXinBrowser&&!isH5&&!isApp
     ? '/big/wx/page/customer?auto=1'
     : '/jyapp/free/customer?auto=1'
 

+ 2 - 0
src/web/staticres/common-module/public/js/utils.js

@@ -183,6 +183,8 @@ var utils = {
     inIOS: window.utilsEnv.platformEnvs.platformOS === 'ios', // 是否在android中
   },
   isWeiXinBrowser: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1,
+  isH5: window.location.href.toLowerCase().indexOf('h5') !== -1,
+  isApp: window.location.href.toLowerCase().indexOf('app') !== -1,
   isAndroid: navigator.userAgent.toLowerCase().indexOf('android') !== -1,
   isIos: /iphone|ipod|ipad|ios/.test(navigator.userAgent.toLowerCase()),
   // 传入你要获取的参数的名字

+ 2 - 2
src/web/templates/big-member/wx/page_pro_follow_detail.html

@@ -1472,9 +1472,9 @@
             },
             // 项目公告跳转到三级页
             getDetail: function (sid) {
-                if (utils.isWeiXinBrowser) {
+                if (utils.isWeiXinBrowser&&window.location.href.indexOf("/jyapp/")<0){
                     location.href = '/article/content/' + sid + '.html'
-                } else {
+                }else {
                     location.href = '/jyapp/article/content/' + sid + '.html'
                 }
             },

+ 2 - 1
src/web/templates/weixin/downloadpage.html

@@ -117,7 +117,8 @@
 			this.style.display = "none";
 		}
 		document.getElementById("download").onclick = function(e){
-			if(!isIos&&isWeixin()){//不是ios,并且微信中打开
+      if(isWeixin()){//不是ios,并且微信中打开
+        // if(!isIos&&isWeixin()){//不是ios,并且微信中打开
 				document.getElementById("rightcorner-bg").style.display = "block";
 				e.preventDefault();
 			}