fix ouType

This commit is contained in:
Gao Wei 2022-06-14 19:34:02 +08:00
parent be6ee674a3
commit 799b43c08b
4 changed files with 18 additions and 5 deletions

View File

@ -32,6 +32,11 @@ public class ContextInfo {
*/
private Long ouId;
/**
* 单位类型
*/
private Integer ouType;
/**
* 如果是企业视角传EntId
* 如果是项目视角传ProjectId

View File

@ -33,6 +33,8 @@ public class LegacyGuessMissedRsp {
private String guessOU = ST_NO_NEED;
private Long ouId = 0L;
private Integer ouType = 0;
private String guessWorkspace = ST_NO_NEED;

View File

@ -1,7 +1,6 @@
package cn.axzo.framework.auth.domain;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -322,11 +321,11 @@ public class TerminalInfo {
* @return
*/
@Deprecated
public List<String> allNames() {
public String[] allNames() {
List<String> list = ntLegacyMap.get(this.newTerminalString);
if (list == null)
return Collections.emptyList();
return list;
return new String[0];
return list.toArray(new String[list.size()]);
}
/**
@ -349,8 +348,9 @@ public class TerminalInfo {
return tm1.isLegacy(t2);
}
public static List<String> allNamesOf(String terminal) {
public static String[] allNamesOf(String terminal) {
TerminalInfo tm = new TerminalInfo(terminal);
return tm.allNames();
}
}

View File

@ -273,6 +273,11 @@ public class ContextInfoBuilderAspect {
BeanUtil.fillBeanWithMap(userinfoMap, userInfo, false);
contextInfo.setUserInfo(userInfo);
try {
contextInfo.setOuType(Integer.parseInt(userinfoMap.get("ouType").toString()));
} catch (Throwable t) {
log.warn("fill ouType error, user identityId="+userInfo.getIdentityId());
}
try {
fillLegacyGuess(contextInfo, userinfoMap);
@ -311,6 +316,7 @@ public class ContextInfoBuilderAspect {
}
if (LegacyGuessMissedRsp.ST_GUESS_OK.equals(rsp.getGuessOU())) {
contextInfo.setOuId(rsp.getOuId());
contextInfo.setOuType(rsp.getOuType());
}
}