...
|
...
|
@@ -8,6 +8,7 @@ import ( |
|
|
"oppmg/common/log"
|
|
|
"oppmg/models"
|
|
|
"oppmg/protocol"
|
|
|
"oppmg/services/ucenter"
|
|
|
"oppmg/storage/redisdata"
|
|
|
"oppmg/utils"
|
|
|
"strings"
|
...
|
...
|
@@ -206,23 +207,23 @@ func LoginAuthByUCenter(account, password string) (protocol.LoginAuthToken, erro |
|
|
} else {
|
|
|
companyid = companys[0].Id
|
|
|
}
|
|
|
// var uclientReturn *ucenter.ResponseLogin
|
|
|
// uclientReturn, err = ucenter.RequestUCenterLogin(account, password)
|
|
|
// if err != nil {
|
|
|
// return logintoken, protocol.NewErrWithMessage("10021")
|
|
|
// }
|
|
|
// //更新用户数据
|
|
|
// _ = uclientReturn
|
|
|
// userdata.Accid = uclientReturn.Data.Accid
|
|
|
// userdata.Icon = uclientReturn.Data.Avatar
|
|
|
// userdata.ImToken = uclientReturn.Data.Imtoken
|
|
|
// userdata.NickName = uclientReturn.Data.NickName
|
|
|
// userdata.CsAccount = uclientReturn.Data.CustomerAccount
|
|
|
// userdata.LastLoginTime = time.Now()
|
|
|
// err = models.UpdateUserById(userdata, []string{"Accid", "Icon", "ImToken", "NickName", "CsAccount", "LastLoginTime"})
|
|
|
// if err != nil {
|
|
|
// log.Error("更新用户数据失败:%s", err)
|
|
|
// }
|
|
|
var uclientReturn *ucenter.ResponseLogin
|
|
|
uclientReturn, err = ucenter.RequestUCenterLogin(account, password)
|
|
|
if err != nil {
|
|
|
return logintoken, protocol.NewErrWithMessage("10021")
|
|
|
}
|
|
|
//更新用户数据
|
|
|
_ = uclientReturn
|
|
|
userdata.Accid = uclientReturn.Data.Accid
|
|
|
userdata.Icon = uclientReturn.Data.Avatar
|
|
|
userdata.ImToken = uclientReturn.Data.Imtoken
|
|
|
userdata.NickName = uclientReturn.Data.NickName
|
|
|
userdata.CsAccount = uclientReturn.Data.CustomerAccount
|
|
|
userdata.LastLoginTime = time.Now()
|
|
|
err = models.UpdateUserById(userdata, []string{"Accid", "Icon", "ImToken", "NickName", "CsAccount", "LastLoginTime"})
|
|
|
if err != nil {
|
|
|
log.Error("更新用户数据失败:%s", err)
|
|
|
}
|
|
|
logintoken, _ = GenerateAuthToken(userdata.Id, companyid)
|
|
|
return logintoken, err
|
|
|
}
|
...
|
...
|
|