When using restful style to verify whether the user name exists, all normal names can be verified, but when verifying whether the email address exists, no parameters can be accepted. The code is as follows
@ApiOperation(value = "查询用户名是否存在", notes = "查询用户名是否存在") @GetMapping("/check/{userName}") public BaseResult checkUserName(@PathVariable("userName") String userName) { return appUserService.checkUserName(userName); }
The following are test pictures
Need to modify the default url matching rules of spring boot
configurer.setUseSuffixPatternMatch(false) means that the URL exposed by the system will not recognize and match the .* suffix.
In this code, it means that Spring will pass sunny.cn to the Controller as a {userName} parameter.
You can also use expressions