|
@@ -38,23 +38,6 @@ public class SysLoginService {
|
|
|
* 登录
|
|
* 登录
|
|
|
*/
|
|
*/
|
|
|
public LoginUser login(String username, String password) {
|
|
public LoginUser login(String username, String password) {
|
|
|
- // 用户名或密码为空 错误
|
|
|
|
|
- if (StringUtils.isAnyBlank(username, password)) {
|
|
|
|
|
- recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
|
|
|
|
- throw new ServiceException("用户/密码必须填写");
|
|
|
|
|
- }
|
|
|
|
|
- // 密码如果不在指定范围内 错误
|
|
|
|
|
- if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
|
|
|
|
- || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
|
|
|
|
- recordLogininfor(username, Constants.LOGIN_FAIL, "用户密码不在指定范围");
|
|
|
|
|
- throw new ServiceException("用户密码不在指定范围");
|
|
|
|
|
- }
|
|
|
|
|
- // 用户名不在指定范围内 错误
|
|
|
|
|
- if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
|
|
|
|
- || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
|
|
|
|
- recordLogininfor(username, Constants.LOGIN_FAIL, "用户名不在指定范围");
|
|
|
|
|
- throw new ServiceException("用户名不在指定范围");
|
|
|
|
|
- }
|
|
|
|
|
LoginUser userInfo;
|
|
LoginUser userInfo;
|
|
|
try {
|
|
try {
|
|
|
// 查询用户信息
|
|
// 查询用户信息
|