在配置类中 重写WebMvcConfigurerAdapter 的 configurePathMatch 方法,设置configurer.setUseSuffixPatternMatch(false); 即可解决。
直接上代码:
//配置类
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Autowired
private AuthInterceptorService authInterceptorService;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new GateInterceptor());
registry.addInterceptor(new AuthInterceptor(authInterceptorService));
}
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
}
//前端代码
var Email =‘54349**@qq.com’
Tools.ajax({
url: Config.basePath + "/web/verify/AlterEmailSendNewLink/+Email ,
type: "get",
data: "",
success: function (data) {
......
}
})
如果 不加代码,后台只能取到 Email= 54349**@qq
加过代码后,后台取到值 Email= 54349**@qq.com
(完)
在@RequestMapping的value中使用SpEL来表示,value中的{version}换成{version:.+}。
- 1
终于可以再一次愉悦地进行玩耍了。