|
|
@@ -6,10 +6,11 @@ import com.java110.core.annotation.Java110Listener;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
import com.java110.core.event.service.api.ServiceDataFlowEvent;
|
|
|
import com.java110.core.factory.AuthenticationFactory;
|
|
|
-import com.java110.intf.user.IUserInnerServiceSMO;
|
|
|
import com.java110.dto.user.UserAttrDto;
|
|
|
import com.java110.dto.user.UserDto;
|
|
|
+import com.java110.intf.user.IUserInnerServiceSMO;
|
|
|
import com.java110.po.userAttr.UserAttrPo;
|
|
|
+import com.java110.utils.cache.CommonCache;
|
|
|
import com.java110.utils.constant.BusinessTypeConstant;
|
|
|
import com.java110.utils.constant.CommonConstant;
|
|
|
import com.java110.utils.constant.ResponseConstant;
|
|
|
@@ -80,7 +81,17 @@ public class UserLoginListener extends AbstractServiceApiPlusListener {
|
|
|
} else {
|
|
|
userDto.setUserName(reqJson.getString("userName"));
|
|
|
}
|
|
|
- userDto.setPassword(AuthenticationFactory.passwdMd5(reqJson.getString("password")));
|
|
|
+ //验证码登录
|
|
|
+ if (reqJson.containsKey("loginByPhone") && reqJson.getBoolean("loginByPhone")) {
|
|
|
+ String code = CommonCache.getValue(reqJson.getString("userName") + "_validateTel");
|
|
|
+
|
|
|
+ if (!reqJson.getString("password").equals(code)) {
|
|
|
+ throw new SMOException("验证码错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ userDto.setPassword(AuthenticationFactory.passwdMd5(reqJson.getString("password")));
|
|
|
+ }
|
|
|
errorInfo = "用户名或密码错误";
|
|
|
} else {
|
|
|
userDto.setKey(reqJson.getString("key"));
|
|
|
@@ -91,7 +102,7 @@ public class UserLoginListener extends AbstractServiceApiPlusListener {
|
|
|
List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto);
|
|
|
|
|
|
if (userDtos == null || userDtos.size() < 1) {
|
|
|
- throw new SMOException("登录失败," + errorInfo);
|
|
|
+ throw new SMOException(errorInfo);
|
|
|
}
|
|
|
|
|
|
//表名登录成功
|