在主启动类添加如下方法
@Bean
public TomcatServletWebServerFactory tomcatServletWebServerFactory() {
// 修改内置的 tomcat 容器配置
TomcatServletWebServerFactory tomcatServlet = new TomcatServletWebServerFactory();
tomcatServlet.addConnectorCustomizers(
(TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "{}")
);
return tomcatServlet;
}