|
@@ -115,7 +115,7 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) |
|
@@ -115,7 +115,7 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) |
115
|
qrcodeMessage, err := cache.Get(queryParam.Key)
|
115
|
qrcodeMessage, err := cache.Get(queryParam.Key)
|
116
|
if err != nil {
|
116
|
if err != nil {
|
117
|
log.Logger.Error(err.Error())
|
117
|
log.Logger.Error(err.Error())
|
118
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, "二维码已失效")
|
118
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, "二维码已失效")
|
119
|
}
|
119
|
}
|
120
|
if !qrcodeMessage.IsLogin {
|
120
|
if !qrcodeMessage.IsLogin {
|
121
|
return failLoginData, nil
|
121
|
return failLoginData, nil
|
|
@@ -132,7 +132,7 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) |
|
@@ -132,7 +132,7 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) |
132
|
cache.Remove(queryParam.Key)
|
132
|
cache.Remove(queryParam.Key)
|
133
|
result, err := svr.getToken(loginToken)
|
133
|
result, err := svr.getToken(loginToken)
|
134
|
if err != nil {
|
134
|
if err != nil {
|
135
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
135
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
136
|
}
|
136
|
}
|
137
|
|
137
|
|
138
|
data := map[string]interface{}{
|
138
|
data := map[string]interface{}{
|
|
@@ -147,14 +147,14 @@ func (svr AuthService) AuthLoginQrcodeBinding(bindingCmd *command.QrcodeBindingC |
|
@@ -147,14 +147,14 @@ func (svr AuthService) AuthLoginQrcodeBinding(bindingCmd *command.QrcodeBindingC |
147
|
qrCache := cache.LoginQrcodeCache{}
|
147
|
qrCache := cache.LoginQrcodeCache{}
|
148
|
qrcodeMessage, err := qrCache.Get(bindingCmd.Key)
|
148
|
qrcodeMessage, err := qrCache.Get(bindingCmd.Key)
|
149
|
if err != nil {
|
149
|
if err != nil {
|
150
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, "您扫描的二维码无效,请确认后重新扫描")
|
150
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, "您扫描的二维码无效,请确认后重新扫描")
|
151
|
}
|
151
|
}
|
152
|
if err := qrcodeMessage.BindUser(bindingCmd.Operator); err != nil {
|
152
|
if err := qrcodeMessage.BindUser(bindingCmd.Operator); err != nil {
|
153
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
153
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
154
|
}
|
154
|
}
|
155
|
if err := qrCache.Save(*qrcodeMessage); err != nil {
|
155
|
if err := qrCache.Save(*qrcodeMessage); err != nil {
|
156
|
log.Logger.Error(err.Error())
|
156
|
log.Logger.Error(err.Error())
|
157
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, "登录失败,请重试")
|
157
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, "登录失败,请重试")
|
158
|
}
|
158
|
}
|
159
|
return struct{}{}, nil
|
159
|
return struct{}{}, nil
|
160
|
}
|
160
|
}
|
|
@@ -170,13 +170,13 @@ func (svr AuthService) SendSmsCaptcha(smsCodeCommand *command.SendSmsCodeCommand |
|
@@ -170,13 +170,13 @@ func (svr AuthService) SendSmsCaptcha(smsCodeCommand *command.SendSmsCodeCommand |
170
|
Account: smsCodeCommand.Phone,
|
170
|
Account: smsCodeCommand.Phone,
|
171
|
})
|
171
|
})
|
172
|
if err != nil || userBase.UserInfo.Phone != smsCodeCommand.Phone {
|
172
|
if err != nil || userBase.UserInfo.Phone != smsCodeCommand.Phone {
|
173
|
- return application.ThrowError(application.TRANSACTION_ERROR, "输入的手机号不是平台用户,请重新输入")
|
173
|
+ return application.ThrowError(application.BUSINESS_ERROR, "输入的手机号不是平台用户,请重新输入")
|
174
|
}
|
174
|
}
|
175
|
}
|
175
|
}
|
176
|
smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
|
176
|
smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
|
177
|
err := smsServeGateway.SendSms(smsCodeCommand.Phone)
|
177
|
err := smsServeGateway.SendSms(smsCodeCommand.Phone)
|
178
|
if err != nil {
|
178
|
if err != nil {
|
179
|
- return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
179
|
+ return application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
180
|
}
|
180
|
}
|
181
|
return nil
|
181
|
return nil
|
182
|
}
|
182
|
}
|
|
@@ -708,7 +708,7 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs |
|
@@ -708,7 +708,7 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs |
708
|
//GetQrcode 获取扫码登录需要的二维码
|
708
|
//GetQrcode 获取扫码登录需要的二维码
|
709
|
func (svr AuthService) GetQrcode() (interface{}, error) {
|
709
|
func (svr AuthService) GetQrcode() (interface{}, error) {
|
710
|
qrcodeMessage := domain.QrcodeMessage{}
|
710
|
qrcodeMessage := domain.QrcodeMessage{}
|
711
|
- _, err := qrcodeMessage.Init() //imgBase64
|
711
|
+ _, err := qrcodeMessage.Init()
|
712
|
if err != nil {
|
712
|
if err != nil {
|
713
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
713
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
714
|
}
|
714
|
}
|