WH01243 4 年之前
父节点
当前提交
cf6cfa1309
共有 1 个文件被更改,包括 16 次插入20 次删除
  1. 16 20
      src/jfw/front/distribution.go

+ 16 - 20
src/jfw/front/distribution.go

@@ -123,13 +123,13 @@ func (this *Distrib) LinkShareX(discored string) error {
 	}
 	return this.Redirect("/distribution/share/" + discored)
 }
+
 //企业分销
 func (this *Distrib) LinkShareG(discored string) error {
-	fmt.Println("jinlaile1")
 	defer util.Catch()
-	//checkIsSubscribeFlag := true
+	checkIsSubscribeFlag := true
 	openid, _ := this.Session().Get("s_m_openid").(string)
-	/*if openid == "" {
+	if openid == "" {
 		if this.GetString("state") == "wx" {
 			//微信跳回来的
 			code := this.GetString("code")
@@ -157,24 +157,20 @@ func (this *Distrib) LinkShareG(discored string) error {
 	} else {
 		//是否为关注用户
 		checkIsSubscribeFlag = CheckUserIsSubscribe(openid)
-	}*/
-	if  openid==""{
-		userId, _ := this.Session().Get("userId").(string)
-		go this.ShareLogs(discored, userId)
-		log.Println("openid:", openid)
-		log.Println("DIS_" + discored[1:])
-		//if !checkIsSubscribeFlag {
-			if discored == "" {
-				log.Println(userId, "分销用户微信分享错误")
-			}
-			//提示关注页面
-			this.T["discored"] = discored
-			log.Println("/weixin/singlelogin/index.html" )
-			return this.Render("/weixin/singlelogin/index.html")
-		//}
 	}
-		log.Println("/distribution/share/" + discored )
-		return this.Redirect("/distribution/share/" + discored)
+	userId, _ := this.Session().Get("userId").(string)
+	go this.ShareLogs(discored, userId)
+	log.Println("openid:", openid)
+	log.Println("DIS_" + discored[1:])
+	if !checkIsSubscribeFlag {
+		if discored == "" {
+			log.Println(userId, "分销用户微信分享错误")
+		}
+		//提示关注页面
+		this.T["discored"] = discored
+		return this.Render("/weixin/singlelogin/index.html")
+	}
+	return this.Redirect("/distribution/share/" + discored)
 }
 
 //type 1:超级订阅 2:数据导出 3:数据报告 4:线上课程5公告信息