|
@@ -27,6 +27,7 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
|
|
|
|
|
|
private static final String SPRING_SECURITY_RESTFUL_PHONE_KEY = "phone";
|
|
|
private static final String SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY = "smsCode";
|
|
|
+ private static final String SPRING_SECURITY_RESTFUL_CHANNEL_KEY = "channel";
|
|
|
private static final String clientIdParameter = "clientId";
|
|
|
|
|
|
private static final String SPRING_SECURITY_RESTFUL_LOGIN_URL = "/smsLogin";
|
|
@@ -45,18 +46,15 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
|
|
|
}
|
|
|
|
|
|
AbstractAuthenticationToken authRequest;
|
|
|
- String principal;
|
|
|
- String credentials;
|
|
|
-
|
|
|
// 手机验证码登陆
|
|
|
- principal = obtainParameter(request, SPRING_SECURITY_RESTFUL_PHONE_KEY);
|
|
|
- credentials = obtainParameter(request, SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY);
|
|
|
+ String principal = obtainParameter(request, SPRING_SECURITY_RESTFUL_PHONE_KEY);
|
|
|
+ String credentials = obtainParameter(request, SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY);
|
|
|
+ String channel = obtainParameter(request, SPRING_SECURITY_RESTFUL_CHANNEL_KEY);
|
|
|
|
|
|
SysUserInfo userInfo = sysUserService.queryUserInfoByPhone(principal);
|
|
|
|
|
|
String clientId = request.getParameter(clientIdParameter);
|
|
|
-
|
|
|
- if (userInfo == null) {
|
|
|
+ if ("H5".equals(channel) && userInfo == null) {
|
|
|
userInfo = sysUserService.initUser(principal,clientId);
|
|
|
}
|
|
|
|