Browse Source

修复验证码异常时network面板的中文会出现乱码问题

tags/v2.1
RuoYi 4 years ago
parent
commit
c0251e5cda
  1. 1
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/ValidateCodeFilter.java

1
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/ValidateCodeFilter.java

@ -59,6 +59,7 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object> @@ -59,6 +59,7 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
catch (Exception e)
{
ServerHttpResponse response = exchange.getResponse();
response.getHeaders().add("Content-Type", "application/json;charset=UTF-8");
return exchange.getResponse().writeWith(
Mono.just(response.bufferFactory().wrap(JSON.toJSONBytes(AjaxResult.error(e.getMessage())))));
}

Loading…
Cancel
Save