fix ouType
This commit is contained in:
parent
be6ee674a3
commit
799b43c08b
@ -32,6 +32,11 @@ public class ContextInfo {
|
||||
*/
|
||||
private Long ouId;
|
||||
|
||||
/**
|
||||
* 单位类型
|
||||
*/
|
||||
private Integer ouType;
|
||||
|
||||
/**
|
||||
* 如果是企业视角,传EntId
|
||||
* 如果是项目视角,传ProjectId
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user