Merge remote-tracking branch 'origin/new_3A' into new_3A
This commit is contained in:
commit
92fc3d5270
@ -28,11 +28,11 @@ import cn.axzo.framework.auth.domain.UserInfo;
|
||||
import cn.axzo.framework.auth.domain.UserInfoMap;
|
||||
import cn.axzo.framework.auth.enums.EnvEnum;
|
||||
import cn.azxo.framework.common.logger.logback.PodNamespacePropertyDefiner;
|
||||
import cn.azxo.framework.common.utils.StrUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpException;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@ -180,7 +180,7 @@ public class ContextInfoBuilderAspect {
|
||||
req.setHeaderSaasTenantId(contextInfo.getSaasTenantId());
|
||||
req.setHeaderTenantId(contextInfo.getTenantId());
|
||||
req.setHeaderWorkspaceId(contextInfo.getWorkspaceId());
|
||||
req.setRequestParamProjectId(StrUtil.nullSafeParseLong(originalRequest.getParameter("projectId")));
|
||||
req.setRequestParamProjectId(nullSafeParseLong(originalRequest.getParameter("projectId")));
|
||||
|
||||
return JSONUtil.toJsonStr(req);
|
||||
}
|
||||
@ -215,10 +215,10 @@ public class ContextInfoBuilderAspect {
|
||||
|
||||
contextInfo.setToken(request.getHeader(AuthConstants.HEADER_TOKEN));
|
||||
contextInfo.setTerminalInfo(new TerminalInfo(request.getHeader(AuthConstants.HEADER_TERMINAL)));
|
||||
contextInfo.setTenantId(StrUtil.nullSafeParseLong(request.getHeader(AuthConstants.HEADER_TENANT_ID)));
|
||||
contextInfo.setSaasTenantId(StrUtil.nullSafeParseLong(request.getHeader(AuthConstants.HEADER_SAAS_TENANT_ID)));
|
||||
contextInfo.setOuId(StrUtil.nullSafeParseLong(request.getHeader(AuthConstants.HEADER_OU_ID)));
|
||||
contextInfo.setWorkspaceId(StrUtil.nullSafeParseLong(request.getHeader(AuthConstants.HEADER_WORKSPACE_ID)));
|
||||
contextInfo.setTenantId(nullSafeParseLong(request.getHeader(AuthConstants.HEADER_TENANT_ID)));
|
||||
contextInfo.setSaasTenantId(nullSafeParseLong(request.getHeader(AuthConstants.HEADER_SAAS_TENANT_ID)));
|
||||
contextInfo.setOuId(nullSafeParseLong(request.getHeader(AuthConstants.HEADER_OU_ID)));
|
||||
contextInfo.setWorkspaceId(nullSafeParseLong(request.getHeader(AuthConstants.HEADER_WORKSPACE_ID)));
|
||||
|
||||
contextInfo.setVisitTo(request.getHeader(AuthConstants.VISIT_TO));
|
||||
}
|
||||
@ -263,5 +263,16 @@ public class ContextInfoBuilderAspect {
|
||||
contextInfo.setOuId(rsp.getOuId());
|
||||
}
|
||||
}
|
||||
|
||||
public static Long nullSafeParseLong(String input) {
|
||||
if(input == null)
|
||||
return 0L;
|
||||
if("".equals(input))
|
||||
return 0L;
|
||||
if("undefined".equals(input))
|
||||
return 0L;
|
||||
return Long.valueOf(input);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
package cn.azxo.framework.common.utils;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 原来的工具类名字太长了,我弄一个名字短一些的。
|
||||
* 把一些原来自己方便使用的小函数写几个在这里。
|
||||
*
|
||||
* @author gaowei
|
||||
*
|
||||
*/
|
||||
public abstract class StrUtil extends StringUtils {
|
||||
public static String killNull(String input) {
|
||||
if(input == null)
|
||||
return "";
|
||||
return input;
|
||||
}
|
||||
|
||||
public static Long nullSafeParseLong(String input) {
|
||||
if(input == null)
|
||||
return 0L;
|
||||
if("".equals(input))
|
||||
return 0L;
|
||||
return Long.valueOf(input);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user