Browse Source

getCurrentDomainUserID()

master
han\hanst 5 days ago
parent
commit
bdccdce4af
  1. 22
      src/main/java/com/gaotao/modules/api/service/impl/IfsApiServiceImpl.java

22
src/main/java/com/gaotao/modules/api/service/impl/IfsApiServiceImpl.java

@ -129,7 +129,7 @@ public class IfsApiServiceImpl implements IfsApiService {
public List<IfsInventoryPartInStock> getInventoryPartInStock(String site,String partNo) throws JsonProcessingException {
Map<String, Object> params = Map.of(
"ifsDBName", ifsDBName,
"domainUserID", domainUserID,
"domainUserID", getCurrentDomainUserID(),
"ifsSiteID", site,
"ifsPartNo", partNo
);
@ -183,16 +183,16 @@ public class IfsApiServiceImpl implements IfsApiService {
}
private String getCurrentDomainUserID() {
// if (ldapFlag) {
// try {
// SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
// if (currentUser != null && StringUtils.isNotBlank(currentUser.getDomainAccount())) {
// return currentUser.getDomainAccount();
// }
// } catch (Exception e) {
// // 如果获取当前用户失败使用默认配置
// }
// }
if (ldapFlag) {
try {
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
if (currentUser != null && StringUtils.isNotBlank(currentUser.getDomainAccount())) {
return currentUser.getDomainAccount();
}
} catch (Exception e) {
// 如果获取当前用户失败使用默认配置
}
}
return domainUserID;
}

Loading…
Cancel
Save