Browse Source

fastjson内存溢出

master
liuchen864 8 months ago
parent
commit
b020d835d4
  1. 4
      win-admin/src/main/java/com/win/web/WinApplication.java
  2. 2
      win-admin/src/main/resources/application.yml
  3. 1
      win-system/src/main/java/com/win/system/service/LinuxAccessService.java

4
win-admin/src/main/java/com/win/web/WinApplication.java

@ -1,11 +1,14 @@
package com.win.web;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.alibaba.fastjson2.JSON;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import static com.alibaba.fastjson2.JSONWriter.Feature.LargeObject;
/**
* 启动程序
*
@ -20,6 +23,7 @@ public class WinApplication {
public static void main(String[] args) {
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(WinApplication.class, args);
JSON.config(LargeObject, true);
System.out.println("闻音启动成功");
}

2
win-admin/src/main/resources/application.yml

@ -6,6 +6,8 @@ spring:
active: dev
main:
allow-bean-definition-overriding: true
tomcat:
max-http-post-size: -1
servlet:
multipart:
enabled: true

1
win-system/src/main/java/com/win/system/service/LinuxAccessService.java

@ -109,7 +109,6 @@ public class LinuxAccessService extends ServiceImpl<LinuxAccessMapper, LinuxAcce
* @param inJson inJson
* @param domain domain
* @return 执行结果
* @throws InterruptedException 命令行异常
* @throws IOException io异常
*/
public AjaxResult executeCommand(LinuxAccess linuxAccess, QadAccess qadAccess, String traceid, String inJson, String domain) throws IOException {

Loading…
Cancel
Save