|
@@ -230,10 +230,15 @@ func (l *Login) Login() error {
|
|
"s_platform": "app",
|
|
"s_platform": "app",
|
|
"s_sourceid": channelCode,
|
|
"s_sourceid": channelCode,
|
|
}
|
|
}
|
|
- // 新用户注册 记录活动来源
|
|
|
|
- activity := l.GetString("activity")
|
|
|
|
- if activity != "" {
|
|
|
|
- data["s_rsource"] = activity
|
|
|
|
|
|
+ // 新用户注册 记录来源
|
|
|
|
+ sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
|
+ if sourceLabel != "" {
|
|
|
|
+ data["s_rsource"] = sourceLabel
|
|
|
|
+ } else {
|
|
|
|
+ activity := l.GetString("activity")
|
|
|
|
+ if activity != "" {
|
|
|
|
+ data["s_rsource"] = activity
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//注册邮箱
|
|
//注册邮箱
|
|
email := l.GetString("email")
|
|
email := l.GetString("email")
|
|
@@ -241,7 +246,6 @@ func (l *Login) Login() error {
|
|
data["s_email"] = email
|
|
data["s_email"] = email
|
|
}
|
|
}
|
|
data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
|
|
data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
|
|
-
|
|
|
|
if resp := config.Middleground.UserCenter.UserAdd(pb.UserAddReq{
|
|
if resp := config.Middleground.UserCenter.UserAdd(pb.UserAddReq{
|
|
Appid: "10000",
|
|
Appid: "10000",
|
|
Phone: phone,
|
|
Phone: phone,
|
|
@@ -253,8 +257,12 @@ func (l *Login) Login() error {
|
|
}
|
|
}
|
|
_id := mongodb.Save("user", data)
|
|
_id := mongodb.Save("user", data)
|
|
if _id != "" {
|
|
if _id != "" {
|
|
|
|
+ if sourceLabel != "" {
|
|
|
|
+ go func() {
|
|
|
|
+ redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
|
+ }()
|
|
|
|
+ }
|
|
userInfo["isNewUser"] = true
|
|
userInfo["isNewUser"] = true
|
|
-
|
|
|
|
jy.ClearPhoneIdentSession(l.Session())
|
|
jy.ClearPhoneIdentSession(l.Session())
|
|
returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
|
|
returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
|
|
if disWord != "" {
|
|
if disWord != "" {
|
|
@@ -573,10 +581,13 @@ func (l *Login) Register() error {
|
|
"s_company": s_entname,
|
|
"s_company": s_entname,
|
|
"s_sourceid": channelCode,
|
|
"s_sourceid": channelCode,
|
|
}
|
|
}
|
|
|
|
+ sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
|
+ if sourceLabel != "" {
|
|
|
|
+ data["s_rsource"] = sourceLabel
|
|
|
|
+ }
|
|
email := l.GetString("email")
|
|
email := l.GetString("email")
|
|
registerclient := jy.NewRegister(jyutil.Compatible.Mgo, jyutil.Compatible.BaseService, jyutil.Compatible.MainMysql, jyutil.Compatible.Middleground)
|
|
registerclient := jy.NewRegister(jyutil.Compatible.Mgo, jyutil.Compatible.BaseService, jyutil.Compatible.MainMysql, jyutil.Compatible.Middleground)
|
|
_, errStr = registerclient.PublicRegister(phone, email, isAndroidOrIOS(l.Header("User-Agent")), data, func(saveid string) {
|
|
_, errStr = registerclient.PublicRegister(phone, email, isAndroidOrIOS(l.Header("User-Agent")), data, func(saveid string) {
|
|
-
|
|
|
|
go func() {
|
|
go func() {
|
|
if disWord != "" {
|
|
if disWord != "" {
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
@@ -611,6 +622,11 @@ func (l *Login) Register() error {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
if errStr == "y" {
|
|
if errStr == "y" {
|
|
|
|
+ if sourceLabel != "" {
|
|
|
|
+ go func() {
|
|
|
|
+ redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
|
+ }()
|
|
|
|
+ }
|
|
returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
|
|
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{}{
|
|
jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", qutil.ObjToString(l.GetSession("mgoUserId")), jy.Jyapp_node1, map[string]interface{}{
|
|
@@ -772,6 +788,10 @@ func (l *Login) WxLogin() {
|
|
"s_jyname": jy.GetUserName("newother", config.Sysconfig["namePrefix"].(string)), //剑鱼昵称
|
|
"s_jyname": jy.GetUserName("newother", config.Sysconfig["namePrefix"].(string)), //剑鱼昵称
|
|
"s_sourceid": channelCode,
|
|
"s_sourceid": channelCode,
|
|
}
|
|
}
|
|
|
|
+ sourceLabel := redis.GetStr("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
|
+ if sourceLabel != "" {
|
|
|
|
+ newUser["s_rsource"] = sourceLabel
|
|
|
|
+ }
|
|
//注册邮箱
|
|
//注册邮箱
|
|
email := l.GetString("email")
|
|
email := l.GetString("email")
|
|
if jy.IsEmail(email) {
|
|
if jy.IsEmail(email) {
|
|
@@ -793,6 +813,11 @@ func (l *Login) WxLogin() {
|
|
}
|
|
}
|
|
|
|
|
|
if _id := mongodb.Save("user", newUser); _id != "" {
|
|
if _id := mongodb.Save("user", newUser); _id != "" {
|
|
|
|
+ if sourceLabel != "" {
|
|
|
|
+ go func() {
|
|
|
|
+ redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
|
|
|
|
+ }()
|
|
|
|
+ }
|
|
returnSign = afterLogin(newUser, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
|
|
returnSign = afterLogin(newUser, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
|
|
if disWord != "" {
|
|
if disWord != "" {
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|