update 优化多用户体系处理 更名 LoginUtils 为 LoginHelper 支持 LoginUser 多级缓存

This commit is contained in:
疯狂的狮子li
2022-01-17 12:03:15 +08:00
parent dc0af0a419
commit a43e6e06e0
24 changed files with 140 additions and 96 deletions

View File

@ -1,5 +1,7 @@
package com.ruoyi.common.enums;
import com.ruoyi.common.exception.UtilException;
import com.ruoyi.common.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -24,4 +26,13 @@ public enum UserType {
APP_USER("app_user:");
private final String userType;
public static UserType getUserType(String str) {
for (UserType value : values()) {
if (StringUtils.contains(str, value.getUserType())) {
return value;
}
}
throw new RuntimeException("'UserType' not found By " + str);
}
}