bug
parent
3d2048e90c
commit
08d42de602
|
|
@ -6,7 +6,9 @@ import org.qinan.safetyeval.domain.exception.ErrorCode;
|
|||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserInfo;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
|
||||
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
||||
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
||||
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
|
@ -17,6 +19,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 本地联调:为免鉴权的企业信息接口注入默认用户上下文,供 MyMetaObjectHandler 填充 org_id / tenant_id。
|
||||
|
|
@ -35,6 +38,8 @@ public class GbsUserSyncInterceptor implements WebMvcConfigurer {
|
|||
"/**/file/**",
|
||||
"/**/tree/**"
|
||||
};
|
||||
@Autowired
|
||||
private OrgPersonnelMapper orgPersonnelMapper;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
|
|
@ -50,7 +55,8 @@ public class GbsUserSyncInterceptor implements WebMvcConfigurer {
|
|||
throw new BizException(ErrorCode.GBS_USER_ERROR);
|
||||
}
|
||||
AccountDO accountDO = accountMapper.selectById(currentUser.getUserId());
|
||||
if (accountDO == null) {
|
||||
OrgPersonnelDO orgPersonnelDO = orgPersonnelMapper.selectById(currentUser.getUserId());
|
||||
if (Objects.isNull(accountDO) && Objects.isNull(orgPersonnelDO)) {
|
||||
// 用户没有gbs信息,自动填充一条数据类型默认监管端
|
||||
AccountDO accountSave = new AccountDO();
|
||||
accountSave.setId(currentUser.getUserId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue