wangchuanjin преди 2 години
родител
ревизия
89adf2826f

+ 2 - 2
src/jfw/filter/mergefilter.go

@@ -24,7 +24,7 @@ type mergeFilter struct {
 
 func (l *mergeFilter) Do() bool {
 
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
 			if sUid, ok := val.(string); sUid != "" && ok { //自动更新当前session为合并后账户
 				if _, sessionVal := jyutil.GetSessionVal(map[string]interface{}{"_id": mongodb.StringTOBsonId(sUid)}); len(sessionVal) > 0 {
@@ -47,7 +47,7 @@ func (l *mergeFilter) Do() bool {
 	}
 
 	//微信解绑-刷新session
-	if sod, uid := l.GetSession["s_m_openid"], l.GetSession["userId"]; sod != nil && sod != "" && uid != nil && uid != "" {
+	if sod, uid := l.GetSession["s_m_openid"], l.GetSession["mgoUserId"]; sod != nil && sod != "" && uid != nil && uid != "" {
 		if mergerTimeStamp := redis.GetStr("session", fmt.Sprintf("accountInfo_unbindWx_%s_%s", uid, sod)); mergerTimeStamp != "" {
 			//每个sessionid仅清除一次
 			if doOncekey := fmt.Sprintf("accountInfo_unbindWx_%s_%s_%s_%s", uid, sod, l.Session.Id(), mergerTimeStamp); redis.Get("session", doOncekey) == nil {

+ 3 - 2
src/jfw/filter/pcUserSalesFilter.go

@@ -1,12 +1,13 @@
 package filter
 
 import (
-	"app.yhyue.com/moapp/jypkg/public"
 	"jy/src/jfw/config"
 	"net/http"
 	"strings"
 	"time"
 
+	"app.yhyue.com/moapp/jypkg/public"
+
 	qu "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 )
@@ -39,7 +40,7 @@ func (l *pcSalesFilter) Do() bool {
 	}
 	//pc判断是否需要留资
 	href := "/swordfish/frontPage/user/sess/set_favorite" // pc端留资页面地址
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		data, ok := public.MQFW.FindById("user", qu.InterfaceToStr(uid), `{"l_registedate":1,"app_first_login":1}`)
 		if ok && data != nil && len(*data) > 0 {
 			if qu.Int64All((*data)["l_registedate"]) >= qu.Int64All(config.Seoconfig["appNewUserTime"]) && qu.IntAll((*data)["app_first_login"]) == 0 {

+ 4 - 3
src/jfw/filter/pcfilter.go

@@ -4,12 +4,13 @@ import (
 	"fmt"
 	"jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
-	"app.yhyue.com/moapp/jypkg/public"
 	"net/http"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"strings"
 	"time"
 
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"app.yhyue.com/moapp/jypkg/public"
+
 	util "app.yhyue.com/moapp/jybase/common"
 
 	"app.yhyue.com/moapp/jybase/redis"
@@ -43,7 +44,7 @@ func (this *pcFilter) Do() bool {
 
 	href := "/?nol=1"
 	//对比session是否一致,不一致则清除掉sessionid
-	if uid := this.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := this.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		userid, _ := uid.(string)
 		sessid := fmt.Sprint(this.Session.Id())
 		//i_unlimited :登录限制

+ 1 - 1
src/jfw/filter/phonefilter.go

@@ -48,7 +48,7 @@ func (l *phoneFilter) Do() bool {
 	if qu.Int64All(l.GetSession["positionType"]) == 1 {
 		return true
 	}
-	userId, _ := l.GetSession["userId"].(string)
+	userId, _ := l.GetSession["mgoUserId"].(string)
 	// 请求过滤
 	pass := func() bool {
 		if !initflag || l.R.Method == "POST" || userId == "" {

+ 3 - 2
src/jfw/filter/wxUserSalesFilter.go

@@ -2,11 +2,12 @@ package filter
 
 import (
 	"jy/src/jfw/config"
-	"app.yhyue.com/moapp/jypkg/public"
 	"net/http"
 	"strings"
 	"time"
 
+	"app.yhyue.com/moapp/jypkg/public"
+
 	qu "app.yhyue.com/moapp/jybase/common"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
@@ -37,7 +38,7 @@ func (l *salesFilter) Do() bool {
 	}
 	if userAgent := l.R.UserAgent(); mobileReg.MatchString(userAgent) || public.CheckWxBrowser(l.R) {
 		href := "/jy_mobile/uersales/newuser" //wx判断是否需要留资
-		if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+		if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 			data, ok := public.MQFW.FindById("user", qu.InterfaceToStr(uid), `{"l_registedate":1,"app_first_login":1}`)
 			if ok && data != nil && len(*data) > 0 {
 				if qu.Int64All((*data)["l_registedate"]) >= qu.Int64All(config.Seoconfig["appNewUserTime"]) && qu.IntAll((*data)["app_first_login"]) == 0 {

+ 1 - 1
src/jfw/modules/app/src/app/filter/mergefilter.go

@@ -25,7 +25,7 @@ type mergeFilter struct {
 
 func (l *mergeFilter) Do() bool {
 	//账户合并-刷新session
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
 			if sUid, ok := val.(string); sUid != "" && ok {
 				log.Printf("账户合并 mergeFilter 自动刷新session old:%s new:%s\n", uid, sUid)

+ 1 - 1
src/jfw/modules/app/src/app/filter/phonefilter.go

@@ -45,7 +45,7 @@ func (l *phoneFilter) Do() bool {
 	if qu.Int64All(l.GetSession["positionType"]) == 1 {
 		return true
 	}
-	userId, _ := l.GetSession["userId"].(string)
+	userId, _ := l.GetSession["mgoUserId"].(string)
 	// 请求过滤
 	pass := func() bool {
 		if !initflag || l.R.Method == "POST" || userId == "" {

+ 4 - 3
src/jfw/modules/subscribepay/src/filter/mergefilter.go

@@ -1,14 +1,15 @@
 package filter
 
 import (
-	"app.yhyue.com/moapp/jybase/redis"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"fmt"
 	"jy/src/jfw/modules/subscribepay/src/config"
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
 	"net/http"
 
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 )
 
@@ -22,7 +23,7 @@ type mergeFilter struct {
 
 func (l *mergeFilter) Do() bool {
 	//账户合并-刷新session
-	if uid := l.GetSession["userId"]; uid != nil && uid != "" {
+	if uid := l.GetSession["mgoUserId"]; uid != nil && uid != "" {
 		if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
 			if sUid, ok := val.(string); sUid != "" && ok {
 				log.Printf("账户合并 mergeFilter 自动刷新session old:%s new:%s\n", uid, sUid)