|
@@ -106,7 +106,7 @@ func (l *Login) Login() error {
|
|
|
}
|
|
|
returnSign := ""
|
|
|
userInfo := map[string]interface{}{}
|
|
|
- status, state := func() (int, int) {
|
|
|
+ status, state := func() (int, int) {
|
|
|
nsqPath, _ := config.Sysconfig["nsq"].(string)
|
|
|
nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
|
reqType := l.GetString("reqType")
|
|
@@ -141,7 +141,7 @@ func (l *Login) Login() error {
|
|
|
"baseUserId": l.GetSession("base_user_id"),
|
|
|
"positionId": l.GetSession("positionId"),
|
|
|
})
|
|
|
- return 1, 1
|
|
|
+ return 1, 1
|
|
|
}
|
|
|
return -1, -1 //用户名或密码不正确
|
|
|
} else if reqType == "signLogin" {
|
|
@@ -275,7 +275,7 @@ func (l *Login) Login() error {
|
|
|
"baseUserId": l.GetSession("base_user_id"),
|
|
|
"positionId": l.GetSession("positionId"),
|
|
|
})
|
|
|
- return 1, 3
|
|
|
+ return 1, 3
|
|
|
}
|
|
|
} else {
|
|
|
//以s_m_phone登录的 需要把s_m_phone转化为s_phone
|
|
@@ -303,23 +303,23 @@ func (l *Login) Login() error {
|
|
|
"baseUserId": l.GetSession("base_user_id"),
|
|
|
"positionId": l.GetSession("positionId"),
|
|
|
})
|
|
|
- return 1, 4
|
|
|
+ return 1, 4
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return 0, -1
|
|
|
}()
|
|
|
//登录source 更新 p414
|
|
|
- channelCode, ckErr := l.Request.Cookie(jy.ChannelCookieName)
|
|
|
- if ckErr != nil {
|
|
|
- log.Println("获取 合作商 code 异常或 无合作商code:", qutil.ObjToString(l.GetSession("phone")))
|
|
|
- channelCode.Value = "jy_app"
|
|
|
+ channelCode := "jy_app"
|
|
|
+ cc, ckErr := l.Request.Cookie(jy.ChannelCookieName)
|
|
|
+ if ckErr == nil {
|
|
|
+ channelCode = cc.Value
|
|
|
}
|
|
|
us := jy.UserSource{
|
|
|
UserId: qutil.ObjToString(l.GetSession("userId")),
|
|
|
Phone: qutil.ObjToString(l.GetSession("phone")),
|
|
|
State: qutil.If(state == 3, 2, 1).(int), //注册/登录标志 1:登录;2:注册
|
|
|
- ChannelCode: channelCode.Value,
|
|
|
+ ChannelCode: channelCode,
|
|
|
EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
|
|
|
CreateTime: time.Now().Format(time.DateTime),
|
|
|
LoginWay: qutil.If(state == 1, state, 2).(int), //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
|
|
@@ -587,7 +587,7 @@ func (l *Login) Register() error {
|
|
|
}()
|
|
|
l.DelSession("registerStep")
|
|
|
jy.ClearPhoneIdentSession(l.Session())
|
|
|
-
|
|
|
+ //剑鱼币
|
|
|
jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", qutil.ObjToString(l.GetSession("mgoUserId")), jy.Jyapp_node1, map[string]interface{}{
|
|
|
"code": 1014, //下载app任务
|
|
|
"types": "downloadApp",
|
|
@@ -598,7 +598,7 @@ func (l *Login) Register() error {
|
|
|
})
|
|
|
if errStr == "y" {
|
|
|
returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
|
|
|
-
|
|
|
+ //剑鱼币
|
|
|
jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", qutil.ObjToString(l.GetSession("mgoUserId")), jy.Jyapp_node1, map[string]interface{}{
|
|
|
"code": 1014, //下载app任务
|
|
|
"types": "downloadApp",
|
|
@@ -607,16 +607,16 @@ func (l *Login) Register() error {
|
|
|
"positionId": l.GetSession("positionId"),
|
|
|
})
|
|
|
//登录source 更新 p414
|
|
|
- channelCode, ckErr := l.Request.Cookie(jy.ChannelCookieName)
|
|
|
- if ckErr != nil {
|
|
|
- log.Println("获取 合作商 code 异常或 无合作商code:", qutil.ObjToString(l.GetSession("phone")))
|
|
|
- channelCode.Value = "jy_app"
|
|
|
+ channelCode := "jy_app"
|
|
|
+ cc, ckErr := l.Request.Cookie(jy.ChannelCookieName)
|
|
|
+ if ckErr == nil {
|
|
|
+ channelCode = cc.Value
|
|
|
}
|
|
|
us := jy.UserSource{
|
|
|
UserId: qutil.ObjToString(l.GetSession("userId")),
|
|
|
Phone: qutil.ObjToString(l.GetSession("phone")),
|
|
|
State: 2, //注册/登录标志 1:登录;2:注册
|
|
|
- ChannelCode: channelCode.Value,
|
|
|
+ ChannelCode: channelCode,
|
|
|
EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
|
|
|
CreateTime: time.Now().Format(time.DateTime),
|
|
|
LoginWay: 1, //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
|
|
@@ -813,16 +813,16 @@ func (l *Login) WxLogin() {
|
|
|
})
|
|
|
if status > 0 {
|
|
|
//登录source 更新 p414
|
|
|
- channelCode, ckErr := l.Request.Cookie(jy.ChannelCookieName)
|
|
|
- if ckErr != nil {
|
|
|
- log.Println("获取 合作商 code 异常或 无合作商code:", qutil.ObjToString(l.GetSession("phone")))
|
|
|
- channelCode.Value = "jy_app"
|
|
|
+ channelCode := "jy_app"
|
|
|
+ cc, ckErr := l.Request.Cookie(jy.ChannelCookieName)
|
|
|
+ if ckErr == nil {
|
|
|
+ channelCode = cc.Value
|
|
|
}
|
|
|
us := jy.UserSource{
|
|
|
UserId: qutil.ObjToString(l.GetSession("userId")),
|
|
|
Phone: qutil.ObjToString(l.GetSession("phone")),
|
|
|
State: status, //注册/登录标志 1:登录;2:注册
|
|
|
- ChannelCode: channelCode.Value,
|
|
|
+ ChannelCode: channelCode,
|
|
|
EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
|
|
|
CreateTime: time.Now().Format(time.DateTime),
|
|
|
LoginWay: 3, //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
|