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 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 8 | import org.springframework.http.HttpStatus; |
| 9 | 9 | import org.springframework.http.ResponseEntity; |
| 10 | +import org.springframework.web.bind.annotation.CrossOrigin; | |
| 10 | 11 | import org.springframework.web.bind.annotation.GetMapping; |
| 11 | 12 | import org.springframework.web.bind.annotation.PathVariable; |
| 12 | 13 | import org.springframework.web.bind.annotation.PostMapping; |
| ... | ... | @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 21 | 22 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 22 | 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 23 | 24 | |
| 25 | +@CrossOrigin | |
| 24 | 26 | @RestController |
| 25 | 27 | @RequestMapping("/api") |
| 26 | 28 | public class DeviceController { | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
| ... | ... | @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; |
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 6 | import org.springframework.http.HttpStatus; |
| 7 | 7 | import org.springframework.http.ResponseEntity; |
| 8 | +import org.springframework.web.bind.annotation.CrossOrigin; | |
| 8 | 9 | import org.springframework.web.bind.annotation.GetMapping; |
| 9 | 10 | import org.springframework.web.bind.annotation.PathVariable; |
| 10 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
| ... | ... | @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 16 | 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 17 | 18 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 18 | 19 | |
| 20 | +@CrossOrigin | |
| 19 | 21 | @RestController |
| 20 | 22 | @RequestMapping("/api") |
| 21 | 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 | import org.springframework.http.HttpStatus; |
| 7 | 7 | import org.springframework.http.ResponseEntity; |
| 8 | 8 | import org.springframework.util.StringUtils; |
| 9 | +import org.springframework.web.bind.annotation.CrossOrigin; | |
| 9 | 10 | import org.springframework.web.bind.annotation.GetMapping; |
| 10 | 11 | import org.springframework.web.bind.annotation.PathVariable; |
| 11 | 12 | import org.springframework.web.bind.annotation.PostMapping; |
| ... | ... | @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 17 | 18 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 18 | 19 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 19 | 20 | |
| 21 | +@CrossOrigin | |
| 20 | 22 | @RestController |
| 21 | 23 | @RequestMapping("/api") |
| 22 | 24 | public class PlaybackController { | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java
| ... | ... | @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; |
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 6 | import org.springframework.http.HttpStatus; |
| 7 | 7 | import org.springframework.http.ResponseEntity; |
| 8 | +import org.springframework.web.bind.annotation.CrossOrigin; | |
| 8 | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| 9 | 10 | import org.springframework.web.bind.annotation.PostMapping; |
| 10 | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -14,6 +15,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 14 | 15 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 15 | 16 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 16 | 17 | |
| 18 | +@CrossOrigin | |
| 17 | 19 | @RestController |
| 18 | 20 | @RequestMapping("/api") |
| 19 | 21 | public class PtzController { | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java
| ... | ... | @@ -4,6 +4,7 @@ import org.slf4j.Logger; |
| 4 | 4 | import org.slf4j.LoggerFactory; |
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 6 | import org.springframework.http.ResponseEntity; |
| 7 | +import org.springframework.web.bind.annotation.CrossOrigin; | |
| 7 | 8 | import org.springframework.web.bind.annotation.GetMapping; |
| 8 | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| 9 | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 16 | 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 17 | 18 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 18 | 19 | |
| 20 | +@CrossOrigin | |
| 19 | 21 | @RestController |
| 20 | 22 | @RequestMapping("/api") |
| 21 | 23 | public class RecordController { | ... | ... |