Kaynağa Gözat

新增跨域

liyuntian 10 ay önce
ebeveyn
işleme
e60fb9cf7e

+ 1 - 0
mcp/src/main/java/com/chuanxia/mcp/controller/CdnDomainCityController.java

@@ -21,6 +21,7 @@ import java.util.List;
 @Api("区域绑定")
 @RequestMapping("cdnDomainCity")
 @RequiredArgsConstructor
+@CrossOrigin(origins = "*")
 public class CdnDomainCityController {
     private final CdnService cdnService;
     private final CdnDoaminService doaminService;

+ 2 - 4
mcp/src/main/java/com/chuanxia/mcp/controller/CdnM3u8Controller.java

@@ -7,10 +7,7 @@ import com.chuanxia.mcp.service.VideoM3u8Service;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -21,6 +18,7 @@ import java.util.List;
 @Api("m3u8文件解析")
 @RequestMapping("cdnM3U8")
 @RequiredArgsConstructor
+@CrossOrigin(origins = "*")
 public class CdnM3u8Controller {
     private final M3U8Utils m3U8Utils;
     private final VideoM3u8Service m3u8Service;

+ 1 - 0
mcp/src/main/java/com/chuanxia/mcp/controller/CdnOperatorController.java

@@ -22,6 +22,7 @@ import java.util.List;
 @Api("cdn运营商管理")
 @RequestMapping("cdnOperator")
 @RequiredArgsConstructor
+@CrossOrigin(origins = "*")
 public class CdnOperatorController {
     private final CdnOperatorService operatorService;
 

+ 1 - 0
mcp/src/main/java/com/chuanxia/mcp/controller/CdnTimeRuleController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 @RequiredArgsConstructor
 @RequestMapping("cdnTimeRule")
 @Api("时间规则配置")
+@CrossOrigin(origins = "*")
 public class CdnTimeRuleController {
     private final CdnTimeRuleService ruleService;
 

+ 2 - 4
mcp/src/main/java/com/chuanxia/mcp/controller/CdnUaController.java

@@ -9,16 +9,14 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequiredArgsConstructor
 @Slf4j
 @RequestMapping("cdnUa")
 @Api("ua管理")
+@CrossOrigin(origins = "*")
 public class CdnUaController {
     private final CdnUaService uaService;
 

+ 1 - 0
mcp/src/main/java/com/chuanxia/mcp/controller/UserController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
 @Api("用户相关")
 @RequestMapping("user")
 @RequiredArgsConstructor
+@CrossOrigin(origins = "*")
 public class UserController {
     private final UserService userService;