json-parse

This commit is contained in:
N1KO 2025-02-18 11:55:10 +08:00
parent ce06c10904
commit 984efd0bf8
3 changed files with 9120 additions and 18 deletions

View File

@ -1,18 +1,18 @@
package top.baogutang.admin.config; //package top.baogutang.admin.config;
//
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; //import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; //import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
@Configuration //@Configuration
public class WebConfig implements WebMvcConfigurer { //public class WebConfig implements WebMvcConfigurer {
//
@Override // @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { // public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**") // registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/"); // .addResourceLocations("classpath:/static/");
//
registry.addResourceHandler("/file-parse/**") // registry.addResourceHandler("/file-parse/**")
.addResourceLocations("classpath:/static/"); // .addResourceLocations("classpath:/static/");
} // }
} //}

File diff suppressed because one or more lines are too long

View File

@ -139,6 +139,8 @@
} }
} }
try { try {
content = content.replace(/\\\s+/g, "");
content = content.replace(/\\/g, '');
content = content.replace(/[\r\n]/g, ""); content = content.replace(/[\r\n]/g, "");
current_json = jsonlint.parse(content); current_json = jsonlint.parse(content);
current_json_str = JSON.stringify(current_json); current_json_str = JSON.stringify(current_json);