mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 20:51:48 +00:00
@@ -23,6 +23,8 @@ public interface UserAdaptor {
|
||||
|
||||
String login(UserReq userReq, HttpServletRequest request);
|
||||
|
||||
String login(UserReq userReq, String appKey);
|
||||
|
||||
List<User> getUserByOrg(String key);
|
||||
|
||||
Set<String> getUserAllOrgId(String userName);
|
||||
|
||||
@@ -21,6 +21,8 @@ public interface UserService {
|
||||
|
||||
String login(UserReq userCmd, HttpServletRequest request);
|
||||
|
||||
String login(UserReq userCmd, String appKey);
|
||||
|
||||
Set<String> getUserAllOrgId(String userName);
|
||||
|
||||
List<User> getUserByOrg(String key);
|
||||
|
||||
@@ -11,4 +11,6 @@ public interface UserStrategy {
|
||||
|
||||
User findUser(HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
User findUser(String token, String appKey);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,10 +5,9 @@ import com.tencent.supersonic.auth.api.authentication.service.UserStrategy;
|
||||
import com.tencent.supersonic.common.pojo.SystemConfig;
|
||||
import com.tencent.supersonic.common.service.SystemConfigService;
|
||||
import com.tencent.supersonic.common.util.ContextUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
public final class UserHolder {
|
||||
|
||||
@@ -20,6 +19,15 @@ public final class UserHolder {
|
||||
|
||||
public static User findUser(HttpServletRequest request, HttpServletResponse response) {
|
||||
User user = REPO.findUser(request, response);
|
||||
return getUser(user);
|
||||
}
|
||||
|
||||
public static User findUser(String token, String appKey) {
|
||||
User user = REPO.findUser(token, appKey);
|
||||
return getUser(user);
|
||||
}
|
||||
|
||||
private static User getUser(User user) {
|
||||
SystemConfigService sysParameterService = ContextUtils.getBean(SystemConfigService.class);
|
||||
SystemConfig systemConfig = sysParameterService.getSystemConfig();
|
||||
if (!CollectionUtils.isEmpty(systemConfig.getAdmins())
|
||||
|
||||
Reference in New Issue
Block a user