Commit 21c0eb821f8d9f6df9bd310e3fef4cbbab83d3cc
1 parent
817fc86c
增加跨域代码,允许VUE跨域访问
Showing
5 changed files
with
10 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceController.java
| @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory; | @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.http.HttpStatus; | 8 | import org.springframework.http.HttpStatus; |
| 9 | import org.springframework.http.ResponseEntity; | 9 | import org.springframework.http.ResponseEntity; |
| 10 | +import org.springframework.web.bind.annotation.CrossOrigin; | ||
| 10 | import org.springframework.web.bind.annotation.GetMapping; | 11 | import org.springframework.web.bind.annotation.GetMapping; |
| 11 | import org.springframework.web.bind.annotation.PathVariable; | 12 | import org.springframework.web.bind.annotation.PathVariable; |
| 12 | import org.springframework.web.bind.annotation.PostMapping; | 13 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 21 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 22 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 22 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 23 | 24 | ||
| 25 | +@CrossOrigin | ||
| 24 | @RestController | 26 | @RestController |
| 25 | @RequestMapping("/api") | 27 | @RequestMapping("/api") |
| 26 | public class DeviceController { | 28 | public class DeviceController { |
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
| @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; | @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.http.HttpStatus; | 6 | import org.springframework.http.HttpStatus; |
| 7 | import org.springframework.http.ResponseEntity; | 7 | import org.springframework.http.ResponseEntity; |
| 8 | +import org.springframework.web.bind.annotation.CrossOrigin; | ||
| 8 | import org.springframework.web.bind.annotation.GetMapping; | 9 | import org.springframework.web.bind.annotation.GetMapping; |
| 9 | import org.springframework.web.bind.annotation.PathVariable; | 10 | import org.springframework.web.bind.annotation.PathVariable; |
| 10 | import org.springframework.web.bind.annotation.PostMapping; | 11 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 16 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 17 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 18 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 18 | 19 | ||
| 20 | +@CrossOrigin | ||
| 19 | @RestController | 21 | @RestController |
| 20 | @RequestMapping("/api") | 22 | @RequestMapping("/api") |
| 21 | public class PlayController { | 23 | public class PlayController { |
src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java
| @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
| 6 | import org.springframework.http.HttpStatus; | 6 | import org.springframework.http.HttpStatus; |
| 7 | import org.springframework.http.ResponseEntity; | 7 | import org.springframework.http.ResponseEntity; |
| 8 | import org.springframework.util.StringUtils; | 8 | import org.springframework.util.StringUtils; |
| 9 | +import org.springframework.web.bind.annotation.CrossOrigin; | ||
| 9 | import org.springframework.web.bind.annotation.GetMapping; | 10 | import org.springframework.web.bind.annotation.GetMapping; |
| 10 | import org.springframework.web.bind.annotation.PathVariable; | 11 | import org.springframework.web.bind.annotation.PathVariable; |
| 11 | import org.springframework.web.bind.annotation.PostMapping; | 12 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 18 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 18 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 19 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 19 | 20 | ||
| 21 | +@CrossOrigin | ||
| 20 | @RestController | 22 | @RestController |
| 21 | @RequestMapping("/api") | 23 | @RequestMapping("/api") |
| 22 | public class PlaybackController { | 24 | public class PlaybackController { |
src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java
| @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; | @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.http.HttpStatus; | 6 | import org.springframework.http.HttpStatus; |
| 7 | import org.springframework.http.ResponseEntity; | 7 | import org.springframework.http.ResponseEntity; |
| 8 | +import org.springframework.web.bind.annotation.CrossOrigin; | ||
| 8 | import org.springframework.web.bind.annotation.PathVariable; | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| 9 | import org.springframework.web.bind.annotation.PostMapping; | 10 | import org.springframework.web.bind.annotation.PostMapping; |
| 10 | import org.springframework.web.bind.annotation.RequestMapping; | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
| @@ -14,6 +15,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | @@ -14,6 +15,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 14 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 15 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 15 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 16 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 16 | 17 | ||
| 18 | +@CrossOrigin | ||
| 17 | @RestController | 19 | @RestController |
| 18 | @RequestMapping("/api") | 20 | @RequestMapping("/api") |
| 19 | public class PtzController { | 21 | public class PtzController { |
src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java
| @@ -4,6 +4,7 @@ import org.slf4j.Logger; | @@ -4,6 +4,7 @@ import org.slf4j.Logger; | ||
| 4 | import org.slf4j.LoggerFactory; | 4 | import org.slf4j.LoggerFactory; |
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.http.ResponseEntity; | 6 | import org.springframework.http.ResponseEntity; |
| 7 | +import org.springframework.web.bind.annotation.CrossOrigin; | ||
| 7 | import org.springframework.web.bind.annotation.GetMapping; | 8 | import org.springframework.web.bind.annotation.GetMapping; |
| 8 | import org.springframework.web.bind.annotation.PathVariable; | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| 9 | import org.springframework.web.bind.annotation.RequestMapping; | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
| @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 16 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 17 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 18 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 18 | 19 | ||
| 20 | +@CrossOrigin | ||
| 19 | @RestController | 21 | @RestController |
| 20 | @RequestMapping("/api") | 22 | @RequestMapping("/api") |
| 21 | public class RecordController { | 23 | public class RecordController { |