update 优化 getLoginId 增加必要参数空校验

2.X
疯狂的狮子li 2022-08-11 12:41:11 +08:00
parent 401551312d
commit f888e66261
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ public class LoginUser implements Serializable {
* id
*/
public String getLoginId() {
if (userType == null) {
throw new IllegalArgumentException("用户类型不能为空");
}
if (userId == null) {
throw new IllegalArgumentException("用户ID不能为空");
}
return userType + CacheConstants.LOGINID_JOIN_CODE + userId;
}