|
@@ -1,6 +1,8 @@
|
|
package front
|
|
package front
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "app.yhyue.com/moapp/jybase/date"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/encrypt"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
"jy/src/jfw/modules/app/src/jfw/config"
|
|
"jy/src/jfw/modules/app/src/jfw/config"
|
|
@@ -105,13 +107,15 @@ func (l *Login) Login() error {
|
|
}
|
|
}
|
|
returnSign := ""
|
|
returnSign := ""
|
|
userInfo := map[string]interface{}{}
|
|
userInfo := map[string]interface{}{}
|
|
- status := func() int {
|
|
|
|
|
|
+ status, state := func() (int, int) {
|
|
|
|
+ nsqPath, _ := config.Sysconfig["nsq"].(string)
|
|
|
|
+ nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
reqType := l.GetString("reqType")
|
|
reqType := l.GetString("reqType")
|
|
if reqType == "phoneLogin" {
|
|
if reqType == "phoneLogin" {
|
|
phone := l.GetString("phone")
|
|
phone := l.GetString("phone")
|
|
password := l.GetString("password")
|
|
password := l.GetString("password")
|
|
if strings.TrimSpace(phone) == "" || strings.TrimSpace(password) == "" {
|
|
if strings.TrimSpace(phone) == "" || strings.TrimSpace(password) == "" {
|
|
- return -1
|
|
|
|
|
|
+ return -1, -1
|
|
}
|
|
}
|
|
query := map[string]interface{}{
|
|
query := map[string]interface{}{
|
|
"i_appid": 2,
|
|
"i_appid": 2,
|
|
@@ -131,9 +135,16 @@ func (l *Login) Login() error {
|
|
deviceId := l.GetString("deviceId")
|
|
deviceId := l.GetString("deviceId")
|
|
phoneType := l.GetString("phoneType")
|
|
phoneType := l.GetString("phoneType")
|
|
returnSign = afterLogin((*user)[0], l.Session(), rid, oid, phoneType, channel, deviceId, false, l.ResponseWriter)
|
|
returnSign = afterLogin((*user)[0], l.Session(), rid, oid, phoneType, channel, deviceId, false, l.ResponseWriter)
|
|
- return 1
|
|
|
|
|
|
+ jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", BsonIdToSId((*user)[0]["_id"]), jy.Jyapp_node1, map[string]interface{}{
|
|
|
|
+ "code": 1014, //下载app任务
|
|
|
|
+ "types": "downloadApp",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": l.GetSession("base_user_id"),
|
|
|
|
+ "positionId": l.GetSession("positionId"),
|
|
|
|
+ })
|
|
|
|
+ return 1, 1
|
|
}
|
|
}
|
|
- return -1 //用户名或密码不正确
|
|
|
|
|
|
+ return -1, -1 //用户名或密码不正确
|
|
} else if reqType == "signLogin" {
|
|
} else if reqType == "signLogin" {
|
|
returnStatus := 0
|
|
returnStatus := 0
|
|
if l.GetSession("mgoUserId") != nil {
|
|
if l.GetSession("mgoUserId") != nil {
|
|
@@ -146,7 +157,7 @@ func (l *Login) Login() error {
|
|
(userInfo)["s_phone"] = l.GetSession("s_phone")
|
|
(userInfo)["s_phone"] = l.GetSession("s_phone")
|
|
(userInfo)["userid"] = l.GetSession("mgoUserId")
|
|
(userInfo)["userid"] = l.GetSession("mgoUserId")
|
|
(userInfo)["app_name"] = l.GetSession("app_name")
|
|
(userInfo)["app_name"] = l.GetSession("app_name")
|
|
- return returnStatus
|
|
|
|
|
|
+ return returnStatus, 2
|
|
} else if reqType == "sendIdentCode" {
|
|
} else if reqType == "sendIdentCode" {
|
|
phone := jy.CheckSendMsg(l.GetString("token"))
|
|
phone := jy.CheckSendMsg(l.GetString("token"))
|
|
if phone == "" {
|
|
if phone == "" {
|
|
@@ -154,18 +165,18 @@ func (l *Login) Login() error {
|
|
}
|
|
}
|
|
//手机号验证不通过
|
|
//手机号验证不通过
|
|
if phone == "" {
|
|
if phone == "" {
|
|
- return -2
|
|
|
|
|
|
+ return -2, -1
|
|
} else if !phoneReg.MatchString(phone) {
|
|
} else if !phoneReg.MatchString(phone) {
|
|
- return -1
|
|
|
|
|
|
+ return -1, -1
|
|
} else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
|
|
} else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
|
|
- return 1
|
|
|
|
|
|
+ return 1, -1
|
|
}
|
|
}
|
|
- return 0
|
|
|
|
|
|
+ return 0, -1
|
|
} else if reqType == "identCodeLogin" {
|
|
} else if reqType == "identCodeLogin" {
|
|
disWord := l.GetString("disWord")
|
|
disWord := l.GetString("disWord")
|
|
phone, _ := l.GetSession("identCodeKey").(string)
|
|
phone, _ := l.GetSession("identCodeKey").(string)
|
|
if phone == "" || l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
|
|
if phone == "" || l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
|
|
- return -1
|
|
|
|
|
|
+ return -1, -1
|
|
} else {
|
|
} else {
|
|
RegLock.Lock()
|
|
RegLock.Lock()
|
|
reg := RegMap[phone]
|
|
reg := RegMap[phone]
|
|
@@ -182,7 +193,7 @@ func (l *Login) Login() error {
|
|
ok, user := getPhoneUser(phone)
|
|
ok, user := getPhoneUser(phone)
|
|
//登录成功
|
|
//登录成功
|
|
if !ok {
|
|
if !ok {
|
|
- return 0
|
|
|
|
|
|
+ return 0, -1
|
|
}
|
|
}
|
|
//用户不存在
|
|
//用户不存在
|
|
rid := l.GetString("rid")
|
|
rid := l.GetString("rid")
|
|
@@ -230,7 +241,7 @@ func (l *Login) Login() error {
|
|
data["base_user_id"] = resp.Data.Id
|
|
data["base_user_id"] = resp.Data.Id
|
|
} else {
|
|
} else {
|
|
log.Println(phone, "调用usercenter失败")
|
|
log.Println(phone, "调用usercenter失败")
|
|
- return -4
|
|
|
|
|
|
+ return -4, -1
|
|
}
|
|
}
|
|
_id := mongodb.Save("user", data)
|
|
_id := mongodb.Save("user", data)
|
|
if _id != "" {
|
|
if _id != "" {
|
|
@@ -238,29 +249,34 @@ func (l *Login) Login() error {
|
|
|
|
|
|
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)
|
|
- addr, _ := config.Sysconfig["nsq"].(string)
|
|
|
|
- nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
|
|
if disWord != "" {
|
|
if disWord != "" {
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
//邀请新用户 调用队列
|
|
//邀请新用户 调用队列
|
|
if redisDisArr := strings.Split(redisDis, "##"); len(redisDisArr) > 1 {
|
|
if redisDisArr := strings.Split(redisDis, "##"); len(redisDisArr) > 1 {
|
|
fromUserId := redisDisArr[1]
|
|
fromUserId := redisDisArr[1]
|
|
- err := jy.Publish(public.Mgo_Log, addr, nsq_topic, jy.Jywx_subscribe_invite, fromUserId, jy.Jyapp_node1, nil)
|
|
|
|
|
|
+ err := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jywx_subscribe_invite, fromUserId, jy.Jyapp_node1, nil)
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invite, fromUserId)
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invite, fromUserId)
|
|
}
|
|
}
|
|
- err = jy.Publish(public.Mgo_Log, addr, nsq_topic, jy.Jywx_subscribe_invited, _id, jy.Jyapp_node1, nil)
|
|
|
|
|
|
+ err = jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jywx_subscribe_invited, _id, jy.Jyapp_node1, nil)
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invited, _id)
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invited, _id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- err := jy.Publish(public.Mgo_Log, addr, nsq_topic, jy.Jyapp_phone_register, _id, jy.Jyapp_node1, nil)
|
|
|
|
|
|
+ err := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jyapp_phone_register, _id, jy.Jyapp_node1, nil)
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Println("nsq队列写入失败-->", err, jy.Jyapp_phone_register, _id)
|
|
log.Println("nsq队列写入失败-->", err, jy.Jyapp_phone_register, _id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return 1
|
|
|
|
|
|
+ jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", _id, jy.Jyapp_node1, map[string]interface{}{
|
|
|
|
+ "code": 1014, //下载app任务
|
|
|
|
+ "types": "downloadApp",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": l.GetSession("base_user_id"),
|
|
|
|
+ "positionId": l.GetSession("positionId"),
|
|
|
|
+ })
|
|
|
|
+ return 1, 3
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//以s_m_phone登录的 需要把s_m_phone转化为s_phone
|
|
//以s_m_phone登录的 需要把s_m_phone转化为s_phone
|
|
@@ -281,12 +297,39 @@ func (l *Login) Login() error {
|
|
}
|
|
}
|
|
jy.ClearPhoneIdentSession(l.Session())
|
|
jy.ClearPhoneIdentSession(l.Session())
|
|
returnSign = afterLogin(user, l.Session(), rid, oid, phoneType, channel, deviceId, false, l.ResponseWriter)
|
|
returnSign = afterLogin(user, l.Session(), rid, oid, phoneType, channel, deviceId, false, l.ResponseWriter)
|
|
- return 1
|
|
|
|
|
|
+ jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", BsonIdToSId(user["_id"]), jy.Jyapp_node1, map[string]interface{}{
|
|
|
|
+ "code": 1014, //下载app任务
|
|
|
|
+ "types": "downloadApp",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": l.GetSession("base_user_id"),
|
|
|
|
+ "positionId": l.GetSession("positionId"),
|
|
|
|
+ })
|
|
|
|
+ return 1, 4
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return 0
|
|
|
|
|
|
+ return 0, -1
|
|
}()
|
|
}()
|
|
|
|
+ //登录source 更新 p414
|
|
|
|
+ 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,
|
|
|
|
+ EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
|
|
|
|
+ CreateTime: time.Now().Format(date.Date_Full_Layout),
|
|
|
|
+ LoginWay: qutil.If(state == 1, state, 2).(int), //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
|
|
|
|
+ Platform: qutil.If(strings.Contains(l.Request.Host, "h5"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
|
|
|
|
+ Ip: qutil.GetIp(l.Request),
|
|
|
|
+ }
|
|
|
|
+ go func(us jy.UserSource) {
|
|
|
|
+ jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
|
|
|
|
+ }(us)
|
|
result := map[string]interface{}{
|
|
result := map[string]interface{}{
|
|
"status": status,
|
|
"status": status,
|
|
"userId": l.GetSession("mgoUserId"),
|
|
"userId": l.GetSession("mgoUserId"),
|
|
@@ -463,6 +506,8 @@ func (l *Login) Register() error {
|
|
return l.Render("/me/register.html", &l.T)
|
|
return l.Render("/me/register.html", &l.T)
|
|
}
|
|
}
|
|
var returnSign string
|
|
var returnSign string
|
|
|
|
+ nsqPath, _ := config.Sysconfig["nsq"].(string)
|
|
|
|
+ nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
status := func() string {
|
|
status := func() string {
|
|
reqType := l.GetString("reqType")
|
|
reqType := l.GetString("reqType")
|
|
if reqType == "sendIdentCode" { //发短信
|
|
if reqType == "sendIdentCode" { //发短信
|
|
@@ -519,25 +564,23 @@ func (l *Login) Register() error {
|
|
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) {
|
|
|
|
|
|
- addr := config.Sysconfig["nsq"].(string)
|
|
|
|
- topic := config.Sysconfig["nsq_topic"].(string)
|
|
|
|
go func() {
|
|
go func() {
|
|
if disWord != "" {
|
|
if disWord != "" {
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
|
|
//邀请新用户 调用队列
|
|
//邀请新用户 调用队列
|
|
if redisDisArr := strings.Split(redisDis, "##"); len(redisDisArr) > 1 {
|
|
if redisDisArr := strings.Split(redisDis, "##"); len(redisDisArr) > 1 {
|
|
fromUserId := redisDisArr[1]
|
|
fromUserId := redisDisArr[1]
|
|
- err := jy.Publish(public.Mgo_Log, addr, topic, jy.Jywx_subscribe_invite, fromUserId, jy.Jyapp_node1, nil)
|
|
|
|
|
|
+ err := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jywx_subscribe_invite, fromUserId, jy.Jyapp_node1, nil)
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invite, fromUserId)
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invite, fromUserId)
|
|
}
|
|
}
|
|
- err = jy.Publish(public.Mgo_Log, addr, topic, jy.Jywx_subscribe_invited, saveid, jy.Jyapp_node1, nil)
|
|
|
|
|
|
+ err = jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jywx_subscribe_invited, saveid, jy.Jyapp_node1, nil)
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invited, saveid)
|
|
log.Println("nsq队列写入失败-->", err, jy.Jywx_subscribe_invited, saveid)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- err := jy.Publish(public.Mgo_Log, addr, topic, jy.Jyapp_phone_register, saveid, jy.Jyapp_node1, nil)
|
|
|
|
|
|
+ err := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jyapp_phone_register, saveid, jy.Jyapp_node1, nil)
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Println("nsq队列写入失败-->", err, jy.Jyapp_phone_register, saveid)
|
|
log.Println("nsq队列写入失败-->", err, jy.Jyapp_phone_register, saveid)
|
|
}
|
|
}
|
|
@@ -545,9 +588,45 @@ func (l *Login) Register() error {
|
|
}()
|
|
}()
|
|
l.DelSession("registerStep")
|
|
l.DelSession("registerStep")
|
|
jy.ClearPhoneIdentSession(l.Session())
|
|
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",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": l.GetSession("base_user_id"),
|
|
|
|
+ "positionId": l.GetSession("positionId"),
|
|
|
|
+ })
|
|
})
|
|
})
|
|
if errStr == "y" {
|
|
if errStr == "y" {
|
|
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{}{
|
|
|
|
+ "code": 1014, //下载app任务
|
|
|
|
+ "types": "downloadApp",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": l.GetSession("base_user_id"),
|
|
|
|
+ "positionId": l.GetSession("positionId"),
|
|
|
|
+ })
|
|
|
|
+ //登录source 更新 p414
|
|
|
|
+ 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,
|
|
|
|
+ EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
|
|
|
|
+ CreateTime: time.Now().Format(date.Date_Full_Layout),
|
|
|
|
+ LoginWay: 1, //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
|
|
|
|
+ Platform: qutil.If(strings.Contains(l.Request.Host, "h5"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
|
|
|
|
+ Ip: qutil.GetIp(l.Request),
|
|
|
|
+ }
|
|
|
|
+ go func(us jy.UserSource) {
|
|
|
|
+ jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
|
|
|
|
+ }(us)
|
|
}
|
|
}
|
|
return errStr
|
|
return errStr
|
|
}()
|
|
}()
|
|
@@ -718,14 +797,46 @@ func (l *Login) WxLogin() {
|
|
log.Println("nsq队列写入失败-->", jy.Jyapp_wx_register, _id)
|
|
log.Println("nsq队列写入失败-->", jy.Jyapp_wx_register, _id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return 1
|
|
|
|
|
|
+ return 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 0
|
|
return 0
|
|
}()
|
|
}()
|
|
|
|
+
|
|
|
|
+ nsqPath, _ := config.Sysconfig["nsq"].(string)
|
|
|
|
+ nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
|
|
|
|
+ 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",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": l.GetSession("base_user_id"),
|
|
|
|
+ "positionId": l.GetSession("positionId"),
|
|
|
|
+ })
|
|
|
|
+ if status > 0 {
|
|
|
|
+ //登录source 更新 p414
|
|
|
|
+ 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,
|
|
|
|
+ EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
|
|
|
|
+ CreateTime: time.Now().Format(date.Date_Full_Layout),
|
|
|
|
+ LoginWay: 3, //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
|
|
|
|
+ Platform: qutil.If(strings.Contains(l.Request.Host, "h5"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
|
|
|
|
+ Ip: qutil.GetIp(l.Request),
|
|
|
|
+ }
|
|
|
|
+ go func(us jy.UserSource) {
|
|
|
|
+ jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
|
|
|
|
+ }(us)
|
|
|
|
+ }
|
|
//返回
|
|
//返回
|
|
result := map[string]interface{}{
|
|
result := map[string]interface{}{
|
|
- "status": status,
|
|
|
|
|
|
+ "status": qutil.If(status > 0, 1, status).(int),
|
|
"userId": l.GetSession("mgoUserId"),
|
|
"userId": l.GetSession("mgoUserId"),
|
|
}
|
|
}
|
|
if returnSign != "" {
|
|
if returnSign != "" {
|