- Spring自带的MD5加密
DigestUtils.md5DigestAsHex("xxxx".getBytes())
- SpringMvc既拦截URL又不拦截静态资源文件
@Configuration
public class MyInterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 实现 WebMvcConfigurer 不会导致静态资源被拦截
registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**");
}
}
- vue中后端定义了String类型,前端又必须要输入数字,写在input里面
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9.]/g,'')}"