|
@@ -2,6 +2,7 @@ package front
|
|
|
|
|
|
import (
|
|
|
qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
+ . "app.yhyue.com/moapp/jybase/date"
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
mgdb "app.yhyue.com/moapp/jybase/mongodb"
|
|
@@ -81,33 +82,54 @@ func (this *SingleLogin) KeyPhrases(key string) error {
|
|
|
mgoUserId = qutil.InterfaceToStr(sess["mgoUserId"])
|
|
|
}
|
|
|
}
|
|
|
- if positionType == 0 {
|
|
|
- var (
|
|
|
- cacheKey = ""
|
|
|
- cacheBool bool
|
|
|
- userInfo = jy.GetBigVipUserBaseMsg(this.Session(), *config.Middleground)
|
|
|
- )
|
|
|
- //非超级订阅 非大会员用户
|
|
|
- switch {
|
|
|
- case strings.Contains(key, "v_"):
|
|
|
- if userInfo.VipStatus > 0 {
|
|
|
- redirectUrl = fmt.Sprintf(setPage, "v")
|
|
|
- } else {
|
|
|
- redirectUrl = fmt.Sprintf(vPay, time.Now().Unix())
|
|
|
- cacheBool = true
|
|
|
- }
|
|
|
- case strings.Contains(key, "m_"):
|
|
|
- if userInfo.Status > 0 {
|
|
|
- redirectUrl = fmt.Sprintf(setPage, "m")
|
|
|
- } else {
|
|
|
- redirectUrl = mPay
|
|
|
- cacheBool = true
|
|
|
+ if userId != "" && positionType == 0 {
|
|
|
+ //绑定手机号判断
|
|
|
+ var isBind bool
|
|
|
+ if phone := qutil.InterfaceToStr(this.GetSession("phone")); phone == "" {
|
|
|
+ //注册时间
|
|
|
+ regTime := qutil.Int64All(this.GetSession("registedate"))
|
|
|
+ //新用户时间
|
|
|
+ accountMergeOnline, _ := config.Sysconfig["accountMergeOnline"].(string)
|
|
|
+ if accountMergeOnline != "" && regTime > 0 {
|
|
|
+ reg := time.Unix(regTime, 0)
|
|
|
+ onLineTime, _ := time.ParseInLocation(Date_Full_Layout, accountMergeOnline, time.Local)
|
|
|
+ //如果未绑定手机号,老用户不用强制绑定;新用户需要绑定手机号
|
|
|
+ if !onLineTime.After(reg) {
|
|
|
+ isBind = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if cacheBool {
|
|
|
- cacheKey = fmt.Sprintf("key_phrases_%s_%s", strings.Split(key, "_")[0], userId)
|
|
|
- if b := redis.Put(redisLimitation, cacheKey, key, 4*60*60); !b {
|
|
|
- log.Println("关键词组 访问记录 缓存存储 异常", cacheKey)
|
|
|
+ //绑定手机号
|
|
|
+ if isBind {
|
|
|
+ redirectUrl = "/front/account/phone/bind?mode=mergeBind&redirectTo=" + encodeURIComponent(this.Request.URL.String())
|
|
|
+ } else {
|
|
|
+ var (
|
|
|
+ cacheKey = ""
|
|
|
+ cacheBool bool
|
|
|
+ userInfo = jy.GetBigVipUserBaseMsg(this.Session(), *config.Middleground)
|
|
|
+ )
|
|
|
+ //非超级订阅 非大会员用户
|
|
|
+ switch {
|
|
|
+ case strings.Contains(key, "v_"):
|
|
|
+ if userInfo.VipStatus > 0 {
|
|
|
+ redirectUrl = fmt.Sprintf(setPage, "v")
|
|
|
+ } else {
|
|
|
+ redirectUrl = fmt.Sprintf(vPay, time.Now().Unix())
|
|
|
+ cacheBool = true
|
|
|
+ }
|
|
|
+ case strings.Contains(key, "m_"):
|
|
|
+ if userInfo.Status > 0 {
|
|
|
+ redirectUrl = fmt.Sprintf(setPage, "m")
|
|
|
+ } else {
|
|
|
+ redirectUrl = mPay
|
|
|
+ cacheBool = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if cacheBool {
|
|
|
+ cacheKey = fmt.Sprintf("key_phrases_%s_%s", strings.Split(key, "_")[0], userId)
|
|
|
+ if b := redis.Put(redisLimitation, cacheKey, key, 4*60*60); !b {
|
|
|
+ log.Println("关键词组 访问记录 缓存存储 异常", cacheKey)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|