Commit 192be92c735502e82481caa108ce876073ff9979
1 parent
3d0529b84e
Exists in
master
and in
1 other branch
增加
Showing 1 changed file with 12 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/LocalCacheSessionStrategy.java
View file @
192be92
... | ... | @@ -3,7 +3,9 @@ |
3 | 3 | import com.google.common.cache.Cache; |
4 | 4 | import com.google.common.cache.CacheBuilder; |
5 | 5 | import com.lyms.platform.common.base.LoginContext; |
6 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
6 | 7 | import com.lyms.platform.common.enums.YnEnums; |
8 | +import com.lyms.platform.common.exception.BusinessException; | |
7 | 9 | import com.lyms.platform.common.exception.TokenException; |
8 | 10 | import com.lyms.platform.common.utils.MD5Utils; |
9 | 11 | import com.lyms.platform.common.utils.TokenUtils; |
... | ... | @@ -11,6 +13,7 @@ |
11 | 13 | import com.lyms.platform.permission.model.UsersQuery; |
12 | 14 | import com.lyms.platform.permission.service.UsersService; |
13 | 15 | import org.apache.commons.collections.CollectionUtils; |
16 | +import org.apache.commons.lang.StringUtils; | |
14 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 18 | |
16 | 19 | import javax.servlet.http.HttpServletRequest; |
... | ... | @@ -63,7 +66,15 @@ |
63 | 66 | |
64 | 67 | UsersQuery membersQuery = new UsersQuery(); |
65 | 68 | membersQuery.setAccount(account); |
66 | - membersQuery.setPwd(MD5Utils.md5(password).toUpperCase()); | |
69 | + if(StringUtils.isNotEmpty(password)){ | |
70 | + membersQuery.setPwd(MD5Utils.md5(password).toUpperCase()); | |
71 | + }else{ | |
72 | + if(StringUtils.isNotEmpty(code)){ | |
73 | + throw new BusinessException(ErrorCodeConstants.BUSINESS_ERROR+"","该版本不支持手机号登录."); | |
74 | + }else{ | |
75 | + throw new BusinessException(ErrorCodeConstants.BUSINESS_ERROR+"","密码不能为空."); | |
76 | + } | |
77 | + } | |
67 | 78 | membersQuery.setYn(YnEnums.YES.getId()); |
68 | 79 | //本地版本忽略code没有短信验证码 |
69 | 80 | List<Users> membersList = usersService.queryUsers(membersQuery); |