|
@ -12,6 +12,7 @@ import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
import com.yihu.jw.security.core.userdetails.jdbc.WlyyUserDetailsService;
|
|
import com.yihu.jw.security.core.userdetails.jdbc.WlyyUserDetailsService;
|
|
import com.yihu.jw.security.dao.OauthKeypairDao;
|
|
import com.yihu.jw.security.dao.OauthKeypairDao;
|
|
|
|
import com.yihu.jw.security.exception.ImgCaptchaException;
|
|
import com.yihu.jw.security.login.service.BaseLoginLogService;
|
|
import com.yihu.jw.security.login.service.BaseLoginLogService;
|
|
import com.yihu.jw.security.model.*;
|
|
import com.yihu.jw.security.model.*;
|
|
import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
|
|
import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
|
|
@ -147,7 +148,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
String text = parameters.get("text");
|
|
String text = parameters.get("text");
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
if(!verifyCaptcha(key,text)){
|
|
if(!verifyCaptcha(key,text)){
|
|
throw new InvalidRequestException("img_captcha error");
|
|
|
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -612,6 +613,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
return handleOAuth2Exception(new Oauth2Envelop("短信请求频率过快,请稍后再试!", -1), e);
|
|
return handleOAuth2Exception(new Oauth2Envelop("短信请求频率过快,请稍后再试!", -1), e);
|
|
} else if (e instanceof IllegalStateException) {
|
|
} else if (e instanceof IllegalStateException) {
|
|
return handleOAuth2Exception(new Oauth2Envelop(e.getMessage(), -1), e);
|
|
return handleOAuth2Exception(new Oauth2Envelop(e.getMessage(), -1), e);
|
|
|
|
}else if (e instanceof ImgCaptchaException) {
|
|
|
|
return handleOAuth2Exception(new Oauth2Envelop(e.getMessage(), ResultStatus.IMG_CAPTCHA), e);
|
|
}
|
|
}
|
|
return handleOAuth2Exception(new Oauth2Envelop(e.getMessage(), -1), e);
|
|
return handleOAuth2Exception(new Oauth2Envelop(e.getMessage(), -1), e);
|
|
}
|
|
}
|