mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 05:12:07 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
+4
@@ -19,6 +19,9 @@ import java.nio.charset.StandardCharsets;
|
||||
@Slf4j
|
||||
public class LoginUserRequestInterceptor implements RequestInterceptor {
|
||||
|
||||
//数据源编码
|
||||
private static final String DATA_SOURCE_CODE = "data-code";
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
@@ -28,6 +31,7 @@ public class LoginUserRequestInterceptor implements RequestInterceptor {
|
||||
String userStr = JsonUtils.toJsonString(user);
|
||||
userStr = URLEncoder.encode(userStr, StandardCharsets.UTF_8.name()); // 编码,避免中文乱码
|
||||
requestTemplate.header(SecurityFrameworkUtils.LOGIN_USER_HEADER, userStr);
|
||||
requestTemplate.header(DATA_SOURCE_CODE, user.getDataCode());
|
||||
} catch (Exception ex) {
|
||||
log.error("[apply][序列化 LoginUser({}) 发生异常]", user, ex);
|
||||
throw ex;
|
||||
|
||||
Reference in New Issue
Block a user