新增webcad生产单导入:1、cadtoken请求网关异常修复;2、cad拆单批量数据组织id缺省补充;

This commit is contained in:
gaoqr
2025-03-10 14:54:42 +08:00
parent b7e371ffa8
commit 526738058e
3 changed files with 12 additions and 3 deletions
@@ -214,7 +214,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
gatewayLog.getEndTime()).toMillis()));
// 设置其它字段
gatewayLog.setUserId(SecurityFrameworkUtils.getLoginUserId(exchange));
gatewayLog.setUserType(SecurityFrameworkUtils.getLoginUserType(exchange));
gatewayLog.setResponseHeaders(response.getHeaders());
gatewayLog.setHttpStatus(response.getStatusCode());
@@ -1,6 +1,7 @@
package com.cf.imes.gateway.util;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.cf.imes.framework.common.util.json.JsonUtils;
import com.cf.imes.gateway.filter.security.LoginUser;
import lombok.SneakyThrows;
@@ -60,8 +61,10 @@ public class SecurityFrameworkUtils {
* @param user 用户
*/
public static void setLoginUser(ServerWebExchange exchange, LoginUser user) {
exchange.getAttributes().put(LOGIN_USER_ID_ATTR, user.getId());
exchange.getAttributes().put(LOGIN_USER_TYPE_ATTR, user.getUserType());
Long userId = user.getId();
if (ObjectUtil.isNotNull(userId)) {
exchange.getAttributes().put(LOGIN_USER_ID_ATTR, userId);
}
}
/**