Common tools (continuous update)

  1. Spring's own MD5 encryption
DigestUtils.md5DigestAsHex("xxxx".getBytes())
  1. SpringMvc intercepts both URL and static resource files
@Configuration
public class MyInterceptorConfig implements WebMvcConfigurer {
    
    
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
    
    
        // 实现 WebMvcConfigurer 不会导致静态资源被拦截
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**");
    }
}

  1. The back end in vue defines the String type, and the front end must input numbers, which are written in input
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9.]/g,'')}"

Guess you like

Origin blog.csdn.net/weixin_43170526/article/details/111271548