1
This commit is contained in:
@@ -427,7 +427,7 @@ func AddAuthBindWithMobile(authInfo *AuthInfo, mobile string) (err error) {
|
|||||||
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
|
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
|
||||||
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
|
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("此接口有执行顺序,请先调用注册登录接口:【第一步:Login,第二不:TiktokDecrypt】")
|
return errors.New("此接口有执行顺序,请先调用注册登录接口:【第一步:Login,第二步:TiktokDecrypt】")
|
||||||
}
|
}
|
||||||
authInfo.AuthBindInfo.UserID = user.UserID
|
authInfo.AuthBindInfo.UserID = user.UserID
|
||||||
//handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
//handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
||||||
|
|||||||
@@ -100,7 +100,17 @@ func (c *Auth2Controller) SendVerifyCode() {
|
|||||||
func (c *Auth2Controller) TiktokDecrypt() {
|
func (c *Auth2Controller) TiktokDecrypt() {
|
||||||
c.callTiktokDecrypt(func(params *tAuth2TiktokDecryptParams) (interface{}, string, error) {
|
c.callTiktokDecrypt(func(params *tAuth2TiktokDecryptParams) (interface{}, string, error) {
|
||||||
phone, err := auth2.DecryptUserMsg(params.SessionKey, params.Iv, params.Msg, params.LoginType)
|
phone, err := auth2.DecryptUserMsg(params.SessionKey, params.Iv, params.Msg, params.LoginType)
|
||||||
return phone, "", err
|
isExist := false
|
||||||
|
if phone != "" {
|
||||||
|
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", phone); err == nil {
|
||||||
|
if user != nil {
|
||||||
|
isExist = true
|
||||||
|
} else {
|
||||||
|
isExist = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map[string]interface{}{"mobile": phone, "isExist": isExist}, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user