Commit 70564219ae079cadf95997e3cfb49a1c8277db52
1 parent
636b7c54
增加SSE跨域支持
Showing
1 changed file
with
2 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/SseController/SseController.java
| ... | ... | @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.SseController; |
| 3 | 3 | import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEventListener; |
| 4 | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | 5 | import org.springframework.stereotype.Controller; |
| 6 | +import org.springframework.web.bind.annotation.CrossOrigin; | |
| 6 | 7 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | 8 | import org.springframework.web.bind.annotation.RequestParam; |
| 8 | 9 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| ... | ... | @@ -13,6 +14,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| 13 | 14 | * @data: 2021-01-20 |
| 14 | 15 | */ |
| 15 | 16 | |
| 17 | +@CrossOrigin | |
| 16 | 18 | @Controller |
| 17 | 19 | @RequestMapping("/api") |
| 18 | 20 | public class SseController { | ... | ... |