|
@@ -1621,19 +1621,13 @@ func (m *Front) About() error {
|
|
|
if !mobileReg.MatchString(m.UserAgent()) && flag == "" {
|
|
|
return m.Redirect("/front/aboutus.html" + util.If(code != "", "?code="+code, "").(string))
|
|
|
}
|
|
|
- from := m.GetString("from") //三级页获取分享用户的openid
|
|
|
- from_openid := ""
|
|
|
- if from != "" {
|
|
|
- fmt.Println("from:", from, util.DecodeArticleId2ByCheck(from))
|
|
|
- decodeArr := util.DecodeArticleId2ByCheck(from)
|
|
|
- if len(decodeArr) > 1 {
|
|
|
- from_openid = decodeArr[1]
|
|
|
- }
|
|
|
+ from_userid, from_openid := "", ""
|
|
|
+ if from := m.GetString("from"); from != "" {
|
|
|
+ from_userid = se.DecodeStringByCheck(from)
|
|
|
}
|
|
|
myopenid, _ := m.Session().Get("s_m_openid").(string)
|
|
|
mynickname, _ := m.Session().Get("s_nickname").(string)
|
|
|
myavatar, _ := m.Session().Get("s_avatar").(string)
|
|
|
- fmt.Println(myopenid, mynickname, "~~")
|
|
|
isSubscribe := false
|
|
|
if myopenid == "" {
|
|
|
if m.GetString("state") == "wx" {
|
|
@@ -1641,7 +1635,6 @@ func (m *Front) About() error {
|
|
|
code := m.GetString("code")
|
|
|
if code != "" {
|
|
|
myopenid = jyutil.Getopenid(code)
|
|
|
- fmt.Println("myooooooooooo:", myopenid)
|
|
|
}
|
|
|
} else {
|
|
|
if public.CheckWxBrowser(m.Request) {
|
|
@@ -1675,14 +1668,15 @@ func (m *Front) About() error {
|
|
|
}
|
|
|
}
|
|
|
if from_openid != "" { //分享关联
|
|
|
- from_userid := ""
|
|
|
fromuser, ok := public.MQFW.FindOne("user", map[string]interface{}{"s_m_openid": from_openid})
|
|
|
if fromuser != nil && len(*fromuser) > 0 && ok {
|
|
|
from_userid = BsonIdToSId((*fromuser)["_id"])
|
|
|
- ok := redis.Put("other", "share_jyb_"+myopenid, from_userid, 60*5)
|
|
|
- if !ok {
|
|
|
- log.Println("分享用户关联redis出错", "分享者:", from_userid, "被分享者:", myopenid)
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if from_userid != "" {
|
|
|
+ ok := redis.Put("other", "share_jyb_"+myopenid, from_userid, 60*5)
|
|
|
+ if !ok {
|
|
|
+ log.Println("分享用户关联redis出错", "分享者:", from_userid, "被分享者:", myopenid)
|
|
|
}
|
|
|
}
|
|
|
qrcodeType := m.GetString("qrcodeType")
|