Parcourir la source

绑定手机号码接口调整

abiao il y a 4 ans
Parent
commit
1da23f4723

+ 4 - 1
go/gopath/src/fohow.com/apps/controllers/permit_controller/permit_controller.go

@@ -5,6 +5,7 @@ import (
 	"encoding/hex"
 	"fmt"
 	"fohow.com/apps/models/token_model"
+	"fohow.com/libs/lib_redis"
 	"fohow.com/libs/tool"
 
 	// "math/rand"
@@ -167,7 +168,9 @@ func (self *PermitController) XcxLogin() {
 		//赠送积分
 		go helpers.SendCent(wxUser.Id, inviteId)
 	}
-	self.SetSession(apps.XcxSessionKey, key.SessionKey)
+	//self.SetSession(apps.XcxSessionKey, key.SessionKey)
+	sessionKey := lib_redis.GetKeySessionKey(wxUser.Id)
+	lib_redis.SetRedisValue(sessionKey, key.SessionKey, time.Hour*10)
 	beego.BeeLogger.Warn("XcxLogin SessionKey=%s", key.SessionKey)
 	if self.CruSession == nil {
 		self.ReturnError(401, apps.NoExist, "", nil)

+ 5 - 0
go/gopath/src/fohow.com/libs/lib_redis/redis.go

@@ -193,3 +193,8 @@ func GetOpenIdRedisKey(code string) string {
 func GetUnionIdRedisKey(code string) string {
 	return fmt.Sprintf("user:unionid%s", code)
 }
+
+//小程序sessionkey
+func GetKeySessionKey(Id int64) string {
+	return fmt.Sprintf("wx_user:session:key%d", Id)
+}