|
@@ -97,8 +97,10 @@ func (s *Short) Article(stype, id string) error {
|
|
bm := mobileReg.MatchString(s.Header("User-Agent"))
|
|
bm := mobileReg.MatchString(s.Header("User-Agent"))
|
|
//是否是微信浏览器
|
|
//是否是微信浏览器
|
|
isWxB := public.CheckWxBrowser(s.Request)
|
|
isWxB := public.CheckWxBrowser(s.Request)
|
|
- userId, _ := s.GetSession("userId").(string)
|
|
|
|
|
|
+ //userId, _ := s.GetSession("userId").(string)
|
|
|
|
+ sess := s.Session().GetMultiple()
|
|
//未登录用户是否访问的微信浏览器
|
|
//未登录用户是否访问的微信浏览器
|
|
|
|
+ userId, _ := sess["userId"].(string)
|
|
if userId == "" {
|
|
if userId == "" {
|
|
if IsWxBrowserContent[stype] {
|
|
if IsWxBrowserContent[stype] {
|
|
if s.GetString("state") == "wx" {
|
|
if s.GetString("state") == "wx" {
|
|
@@ -108,7 +110,9 @@ func (s *Short) Article(stype, id string) error {
|
|
if CheckUserIsSubscribe(openid) {
|
|
if CheckUserIsSubscribe(openid) {
|
|
FindUserAndCreateSess(openid, s.Session(), "wx", false, true)
|
|
FindUserAndCreateSess(openid, s.Session(), "wx", false, true)
|
|
//生session后 重新获取一下
|
|
//生session后 重新获取一下
|
|
- userId, _ = s.GetSession("userId").(string)
|
|
|
|
|
|
+ //userId, _ = s.GetSession("userId").(string)
|
|
|
|
+ sess = s.Session().GetMultiple()
|
|
|
|
+ userId, _ = sess["userId"].(string)
|
|
} else if !bm { //未关注用户 pc端到关注页面
|
|
} else if !bm { //未关注用户 pc端到关注页面
|
|
log.Println("PC微信端浏览器 未关注用户 访问地址----")
|
|
log.Println("PC微信端浏览器 未关注用户 访问地址----")
|
|
s.Request.Header.Del("Referer")
|
|
s.Request.Header.Del("Referer")
|
|
@@ -131,10 +135,10 @@ func (s *Short) Article(stype, id string) error {
|
|
// return s.Redirect("/notin/page")
|
|
// return s.Redirect("/notin/page")
|
|
//}
|
|
//}
|
|
}
|
|
}
|
|
- return s.LoginCommon(userId, stype, id, bm)
|
|
|
|
|
|
+ return s.LoginCommon(sess, stype, id, bm)
|
|
}
|
|
}
|
|
|
|
|
|
-func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
|
|
|
|
+func (s *Short) LoginCommon(sess map[string]interface{}, stype, id string, bm bool) error {
|
|
//电脑端 剑鱼快照页面访问
|
|
//电脑端 剑鱼快照页面访问
|
|
if stype == "content" && !bm {
|
|
if stype == "content" && !bm {
|
|
//工作桌面内嵌 快照页
|
|
//工作桌面内嵌 快照页
|
|
@@ -149,7 +153,8 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
return s.Redirect(fmt.Sprintf("%s%s%s", config.Sysconfig["workDesktopUrl"].(string), config.Sysconfig["webdomain"].(string), url.QueryEscape(strings.Replace(s.Request.URL.String(), replaceStr, paramSuffix, 1))))
|
|
return s.Redirect(fmt.Sprintf("%s%s%s", config.Sysconfig["workDesktopUrl"].(string), config.Sysconfig["webdomain"].(string), url.QueryEscape(strings.Replace(s.Request.URL.String(), replaceStr, paramSuffix, 1))))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- getsession := s.Session().GetMultiple()
|
|
|
|
|
|
+ userId, _ := sess["userId"].(string)
|
|
|
|
+ //getsession := s.Session().GetMultiple()
|
|
//先判断是否有session
|
|
//先判断是否有session
|
|
source := s.GetString("source")
|
|
source := s.GetString("source")
|
|
disWord := s.GetString("disWord")
|
|
disWord := s.GetString("disWord")
|
|
@@ -230,7 +235,7 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
s.T["logid"] = config.Seoconfig["jysskzy"].(string)
|
|
s.T["logid"] = config.Seoconfig["jysskzy"].(string)
|
|
s.T["shareid"] = se.EncodeString(shareid)
|
|
s.T["shareid"] = se.EncodeString(shareid)
|
|
s.T["keywords"] = s.GetString("kds")
|
|
s.T["keywords"] = s.GetString("kds")
|
|
- ssOpenid := getsession["s_m_openid"]
|
|
|
|
|
|
+ ssOpenid := sess["s_m_openid"]
|
|
po, bo, wo, obj := pcVRT(sid, industry, stype, true, true)
|
|
po, bo, wo, obj := pcVRT(sid, industry, stype, true, true)
|
|
if obj != nil && len(obj) > 0 {
|
|
if obj != nil && len(obj) > 0 {
|
|
|
|
|
|
@@ -291,7 +296,7 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
return s.SetBody([]byte(res.(string)))
|
|
return s.SetBody([]byte(res.(string)))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ssOpenid := getsession["s_m_openid"]
|
|
|
|
|
|
+ ssOpenid := sess["s_m_openid"]
|
|
var (
|
|
var (
|
|
res *map[string]interface{}
|
|
res *map[string]interface{}
|
|
ok bool
|
|
ok bool
|
|
@@ -305,7 +310,6 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
//判断用户是否是vip
|
|
//判断用户是否是vip
|
|
res = jyutil.Compatible.Select(userId, `{"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone":1,"l_vip_starttime":1}`)
|
|
res = jyutil.Compatible.Select(userId, `{"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone":1,"l_vip_starttime":1}`)
|
|
}
|
|
}
|
|
- entid := util.Int64All(s.GetSession("entId"))
|
|
|
|
userPower := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
|
|
userPower := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
|
|
var (
|
|
var (
|
|
isEntnicheNew bool = userPower.EntIsNew //新版超级订阅
|
|
isEntnicheNew bool = userPower.EntIsNew //新版超级订阅
|
|
@@ -322,7 +326,8 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
isOldVip = true
|
|
isOldVip = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- entId := util.IntAll(entid)
|
|
|
|
|
|
+ //entid := util.Int64All(s.GetSession("entId"))
|
|
|
|
+ entId := util.IntAll(sess["entId"])
|
|
if entId > 0 && userPower.EntInfo[entId] != nil {
|
|
if entId > 0 && userPower.EntInfo[entId] != nil {
|
|
isEntniche = userPower.EntInfo[entId].Status == 1 && userPower.EntInfo[entId].IsPower
|
|
isEntniche = userPower.EntInfo[entId].Status == 1 && userPower.EntInfo[entId].IsPower
|
|
isEntnicheNew = userPower.EntInfo[entId].IsNew && isEntniche
|
|
isEntnicheNew = userPower.EntInfo[entId].IsNew && isEntniche
|
|
@@ -366,7 +371,8 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
|
|
|
|
if stype == "advancedProject" {
|
|
if stype == "advancedProject" {
|
|
//判断此用户是否有打开的权限
|
|
//判断此用户是否有打开的权限
|
|
- newUserId := s.GetSession("base_user_id")
|
|
|
|
|
|
+ //newUserId := s.GetSession("base_user_id")
|
|
|
|
+ newUserId := sess["base_user_id"]
|
|
pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
|
|
pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
|
|
//访问次数加1
|
|
//访问次数加1
|
|
if pushData == nil {
|
|
if pushData == nil {
|
|
@@ -380,15 +386,17 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
if shareopenid != "" {
|
|
if shareopenid != "" {
|
|
s.T["shareopenid"] = shareopenid
|
|
s.T["shareopenid"] = shareopenid
|
|
}
|
|
}
|
|
- myopenid, _ := getsession["s_m_openid"].(string)
|
|
|
|
|
|
+ myopenid, _ := sess["s_m_openid"].(string)
|
|
if myopenid == "" {
|
|
if myopenid == "" {
|
|
myopenid = shareopenid
|
|
myopenid = shareopenid
|
|
s.T["openid"] = myopenid //"-1"
|
|
s.T["openid"] = myopenid //"-1"
|
|
} else {
|
|
} else {
|
|
s.T["openid"] = se.EncodeString(myopenid) //"-1"
|
|
s.T["openid"] = se.EncodeString(myopenid) //"-1"
|
|
}
|
|
}
|
|
- mynickname, _ := s.GetSession("s_nickname").(string)
|
|
|
|
- myavatar, _ := s.GetSession("s_avatar").(string)
|
|
|
|
|
|
+ //mynickname, _ := s.GetSession("s_nickname").(string)
|
|
|
|
+ //myavatar, _ := s.GetSession("s_avatar").(string)
|
|
|
|
+ mynickname := util.ObjToString(sess["s_nickname"])
|
|
|
|
+ myavatar := util.ObjToString(sess["s_avatar"])
|
|
s.T["nickname"] = mynickname
|
|
s.T["nickname"] = mynickname
|
|
s.T["avatar"] = myavatar
|
|
s.T["avatar"] = myavatar
|
|
s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
|
|
s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
|
|
@@ -496,7 +504,8 @@ func (s *Short) LoginCommon(userId, stype, id string, bm bool) error {
|
|
}
|
|
}
|
|
if stype == "advancedProject" {
|
|
if stype == "advancedProject" {
|
|
//判断此用户是否有打开的权限
|
|
//判断此用户是否有打开的权限
|
|
- newUserId := s.GetSession("base_user_id")
|
|
|
|
|
|
+ //newUserId := s.GetSession("base_user_id")
|
|
|
|
+ newUserId := sess["base_user_id"]
|
|
pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
|
|
pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
|
|
//访问次数加1
|
|
//访问次数加1
|
|
if pushData == nil {
|
|
if pushData == nil {
|
|
@@ -1188,14 +1197,15 @@ func SearchFilter(obj map[string]interface{}) map[string]interface{} {
|
|
}
|
|
}
|
|
|
|
|
|
func (s *Short) NologinArticle(stype, id string) error {
|
|
func (s *Short) NologinArticle(stype, id string) error {
|
|
- userId := util.ObjToString(s.GetSession("userId"))
|
|
|
|
|
|
+ sess := s.Session().GetMultiple()
|
|
|
|
+ userId := util.ObjToString(sess["userId"])
|
|
sids := encrypt.CommonDecodeArticle(stype, id)
|
|
sids := encrypt.CommonDecodeArticle(stype, id)
|
|
if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
|
|
if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
|
|
s.Redirect("/notin/page", 302)
|
|
s.Redirect("/notin/page", 302)
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
if userId != "" { //已登录用户直接跳转至正常三级页
|
|
if userId != "" { //已登录用户直接跳转至正常三级页
|
|
- return s.LoginCommon(userId, stype, id, mobileReg.MatchString(s.Header("User-Agent"))) //是否是移动端
|
|
|
|
|
|
+ return s.LoginCommon(sess, stype, id, mobileReg.MatchString(s.Header("User-Agent"))) //是否是移动端
|
|
}
|
|
}
|
|
if detailNeedMosaic == nil {
|
|
if detailNeedMosaic == nil {
|
|
detailNeedMosaic, _ = config.Sysconfig["detailNeedMosaic"].(map[string]interface{})
|
|
detailNeedMosaic, _ = config.Sysconfig["detailNeedMosaic"].(map[string]interface{})
|