...
|
...
|
@@ -115,7 +115,7 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) |
|
|
qrcodeMessage, err := cache.Get(queryParam.Key)
|
|
|
if err != nil {
|
|
|
log.Logger.Error(err.Error())
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "二维码已失效")
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "二维码已失效")
|
|
|
}
|
|
|
if !qrcodeMessage.IsLogin {
|
|
|
return failLoginData, nil
|
...
|
...
|
@@ -132,7 +132,7 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) |
|
|
cache.Remove(queryParam.Key)
|
|
|
result, err := svr.getToken(loginToken)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
data := map[string]interface{}{
|
...
|
...
|
@@ -147,14 +147,14 @@ func (svr AuthService) AuthLoginQrcodeBinding(bindingCmd *command.QrcodeBindingC |
|
|
qrCache := cache.LoginQrcodeCache{}
|
|
|
qrcodeMessage, err := qrCache.Get(bindingCmd.Key)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "您扫描的二维码无效,请确认后重新扫描")
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "您扫描的二维码无效,请确认后重新扫描")
|
|
|
}
|
|
|
if err := qrcodeMessage.BindUser(bindingCmd.Operator); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
if err := qrCache.Save(*qrcodeMessage); err != nil {
|
|
|
log.Logger.Error(err.Error())
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "登录失败,请重试")
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "登录失败,请重试")
|
|
|
}
|
|
|
return struct{}{}, nil
|
|
|
}
|
...
|
...
|
@@ -170,13 +170,13 @@ func (svr AuthService) SendSmsCaptcha(smsCodeCommand *command.SendSmsCodeCommand |
|
|
Account: smsCodeCommand.Phone,
|
|
|
})
|
|
|
if err != nil || userBase.UserInfo.Phone != smsCodeCommand.Phone {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, "输入的手机号不是平台用户,请重新输入")
|
|
|
return application.ThrowError(application.BUSINESS_ERROR, "输入的手机号不是平台用户,请重新输入")
|
|
|
}
|
|
|
}
|
|
|
smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
|
|
|
err := smsServeGateway.SendSms(smsCodeCommand.Phone)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
return nil
|
|
|
}
|
...
|
...
|
@@ -708,7 +708,7 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs |
|
|
//GetQrcode 获取扫码登录需要的二维码
|
|
|
func (svr AuthService) GetQrcode() (interface{}, error) {
|
|
|
qrcodeMessage := domain.QrcodeMessage{}
|
|
|
_, err := qrcodeMessage.Init() //imgBase64
|
|
|
_, err := qrcodeMessage.Init()
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|