This commit is contained in:
chenjianxing 2020-03-13 21:01:33 +08:00
commit 96a1b0b95c
2 changed files with 5 additions and 4 deletions

View File

@ -11,6 +11,7 @@ import org.apache.shiro.authc.*;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@ -49,8 +50,8 @@ public class LoginController {
// 自动选中组织工作空间
if (StringUtils.isBlank(user.getLastOrganizationId())) {
List<UserRole> userRoles = user.getUserRoles();
List<UserRole> test = userRoles.stream().filter(ur -> ur.getRoleId().indexOf("test") > -1).collect(Collectors.toList());
List<UserRole> org = userRoles.stream().filter(ur -> ur.getRoleId().indexOf("org") > -1).collect(Collectors.toList());
List<UserRole> test = userRoles.stream().filter(ur -> ur.getRoleId().startsWith("test")).collect(Collectors.toList());
List<UserRole> org = userRoles.stream().filter(ur -> ur.getRoleId().startsWith("org")).collect(Collectors.toList());
if (test.size() > 0) {
String wsId = test.get(0).getSourceId();
userService.switchUserRole(user, "workspace", wsId);

View File

@ -145,7 +145,7 @@
<appender-ref ref="console" />
</root>
<logger name="com.fruit" additivity="false">
<logger name="io.metersphere" additivity="false">
<level value="${logger.level:INFO}" />
<appender-ref ref="debugAsyncAppender" />
<appender-ref ref="infoAsyncAppender" />
@ -153,7 +153,7 @@
<appender-ref ref="errorAsyncAppender" />
</logger>
<logger name="com.fruit.peach.Application" additivity="false" level="${logger.level:INFO}">
<logger name="io.metersphere.Application" additivity="false" level="${logger.level:INFO}">
<appender-ref ref="infoAsyncAppender" />
</logger>