瀏覽代碼

To accept application/json

tags/Baseline_30082024_BACKEND_UAT
MSI\2Fi 1 年之前
父節點
當前提交
a511b0e8af
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. +7
    -0
      src/main/java/com/ffii/tsms/config/WebConfig.java

+ 7
- 0
src/main/java/com/ffii/tsms/config/WebConfig.java 查看文件

@@ -2,6 +2,8 @@ package com.ffii.tsms.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -26,4 +28,9 @@ public class WebConfig implements WebMvcConfigurer {
return new InternalResourceViewResolver();
}

@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.defaultContentType(MediaType.APPLICATION_JSON);
}

}

Loading…
取消
儲存