|
@@ -220,20 +220,33 @@ func (l *Login) Login() error {
|
|
|
}
|
|
|
_id := mongodb.Save("user", data)
|
|
|
if _id != "" {
|
|
|
- redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
- //用户日志保存
|
|
|
- referer := l.Refer()
|
|
|
- go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", source, "", gconv.String(l.GetSession("RSource")), gconv.String(sessVal["RSource"]), qutil.GetIp(l.Request), l.UserAgent(), "jybx", "", referer)
|
|
|
- jy.ClearPhoneIdentSession(l.Session())
|
|
|
- ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
|
|
|
- userInfo["isNewUser"] = true
|
|
|
- nsqPath, _ := config.Sysconfig["nsq"].(string)
|
|
|
- nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
|
- er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2, nil)
|
|
|
- if er != nil {
|
|
|
- log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
|
|
|
- }
|
|
|
- if ok {
|
|
|
+ redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
+ //用户日志保存
|
|
|
+ referer := l.Refer()
|
|
|
+ go jy.SaveUserLog(public.Mgo_Log,
|
|
|
+ _id,
|
|
|
+ phone,
|
|
|
+ "phone",
|
|
|
+ "pc",
|
|
|
+ source,
|
|
|
+ "",
|
|
|
+ jyutil.GetSearchEngine(gconv.String(l.GetSession("RSource"))),
|
|
|
+ gconv.String(sessVal["RSource"]),
|
|
|
+ qutil.GetIp(l.Request),
|
|
|
+ l.UserAgent(),
|
|
|
+ "jybx",
|
|
|
+ "",
|
|
|
+ referer)
|
|
|
+ jy.ClearPhoneIdentSession(l.Session())
|
|
|
+ ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
|
|
|
+ userInfo["isNewUser"] = true
|
|
|
+ nsqPath, _ := config.Sysconfig["nsq"].(string)
|
|
|
+ nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
|
+ er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2, nil)
|
|
|
+ if er != nil {
|
|
|
+ log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
|
|
|
+ }
|
|
|
+ if ok {
|
|
|
sessVal = l.Session().GetMultiple()
|
|
|
result["userInfo"] = userInfo
|
|
|
go anonymousLogin(l.Session(), l.Cookie("JYTrustedId"))
|