Commit 4010ed6c23d081a2937d0fe1719414ba127b17a2
1 parent
27df8bd8
统一axios写法
Showing
28 changed files
with
243 additions
and
218 deletions
pom.xml
| @@ -109,6 +109,12 @@ | @@ -109,6 +109,12 @@ | ||
| 109 | <artifactId>springfox-boot-starter</artifactId> | 109 | <artifactId>springfox-boot-starter</artifactId> |
| 110 | <version>3.0.0</version> | 110 | <version>3.0.0</version> |
| 111 | </dependency> | 111 | </dependency> |
| 112 | + <dependency> | ||
| 113 | + <groupId>com.github.xiaoymin</groupId> | ||
| 114 | + <artifactId>knife4j-spring-boot-starter</artifactId> | ||
| 115 | + <version>3.0.2</version> | ||
| 116 | + </dependency> | ||
| 117 | + | ||
| 112 | 118 | ||
| 113 | <!--参数校验 --> | 119 | <!--参数校验 --> |
| 114 | <dependency> | 120 | <dependency> |
| @@ -165,7 +171,7 @@ | @@ -165,7 +171,7 @@ | ||
| 165 | </dependencies> | 171 | </dependencies> |
| 166 | 172 | ||
| 167 | <build> | 173 | <build> |
| 168 | - <finalName>wvp-2.5.8</finalName> | 174 | + <finalName>wvp-2.0</finalName> |
| 169 | <plugins> | 175 | <plugins> |
| 170 | <plugin> | 176 | <plugin> |
| 171 | <groupId>org.springframework.boot</groupId> | 177 | <groupId>org.springframework.boot</groupId> |
src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java
| @@ -92,8 +92,8 @@ public class Swagger3Config { | @@ -92,8 +92,8 @@ public class Swagger3Config { | ||
| 92 | return new ApiInfoBuilder() | 92 | return new ApiInfoBuilder() |
| 93 | .title("WVP-PRO 接口文档") | 93 | .title("WVP-PRO 接口文档") |
| 94 | .description("更多请咨询服务开发者(18010473990@@163.com)。") | 94 | .description("更多请咨询服务开发者(18010473990@@163.com)。") |
| 95 | - .contact(new Contact("Ray。", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com")) | ||
| 96 | - .version("1.0") | 95 | + .contact(new Contact("panlinlin", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com")) |
| 96 | + .version("2.0") | ||
| 97 | .build(); | 97 | .build(); |
| 98 | } | 98 | } |
| 99 | } | 99 | } |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -84,7 +84,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -84,7 +84,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 84 | } else { | 84 | } else { |
| 85 | String streamId = streamInfo.getStreamId(); | 85 | String streamId = streamInfo.getStreamId(); |
| 86 | JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(streamId); | 86 | JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(streamId); |
| 87 | - if (rtpInfo.getBoolean("exist")) { | 87 | + if (rtpInfo != null && rtpInfo.getBoolean("exist")) { |
| 88 | RequestMessage msg = new RequestMessage(); | 88 | RequestMessage msg = new RequestMessage(); |
| 89 | msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); | 89 | msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); |
| 90 | msg.setData(JSON.toJSONString(streamInfo)); | 90 | msg.setData(JSON.toJSONString(streamInfo)); |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
| @@ -118,12 +118,11 @@ public class StreamProxyServiceImpl implements IStreamProxyService { | @@ -118,12 +118,11 @@ public class StreamProxyServiceImpl implements IStreamProxyService { | ||
| 118 | public boolean stop(String app, String stream) { | 118 | public boolean stop(String app, String stream) { |
| 119 | boolean result = false; | 119 | boolean result = false; |
| 120 | StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream); | 120 | StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream); |
| 121 | - if (streamProxyDto.isEnable() && streamProxyDto != null) { | 121 | + if (streamProxyDto != null && streamProxyDto.isEnable()) { |
| 122 | JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto); | 122 | JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto); |
| 123 | if (jsonObject.getInteger("code") == 0) { | 123 | if (jsonObject.getInteger("code") == 0) { |
| 124 | - result = true; | ||
| 125 | streamProxyDto.setEnable(false); | 124 | streamProxyDto.setEnable(false); |
| 126 | - videoManagerStorager.updateStreamProxy(streamProxyDto); | 125 | + result = videoManagerStorager.updateStreamProxy(streamProxyDto); |
| 127 | } | 126 | } |
| 128 | } | 127 | } |
| 129 | return result; | 128 | return result; |
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
| @@ -24,7 +24,7 @@ public interface GbStreamMapper { | @@ -24,7 +24,7 @@ public interface GbStreamMapper { | ||
| 24 | "name=#{name}," + | 24 | "name=#{name}," + |
| 25 | "streamType=#{streamType}," + | 25 | "streamType=#{streamType}," + |
| 26 | "longitude=#{longitude}, " + | 26 | "longitude=#{longitude}, " + |
| 27 | - "latitude=#{latitude} " + | 27 | + "latitude=#{latitude}," + |
| 28 | "status=${status} " + | 28 | "status=${status} " + |
| 29 | "WHERE app=#{app} AND stream=#{stream} AND gbId=#{gbId}") | 29 | "WHERE app=#{app} AND stream=#{stream} AND gbId=#{gbId}") |
| 30 | int update(GbStream gbStream); | 30 | int update(GbStream gbStream); |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| @@ -440,6 +440,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | @@ -440,6 +440,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | ||
| 440 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 | 440 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| 441 | result = true; | 441 | result = true; |
| 442 | }catch (Exception e) { | 442 | }catch (Exception e) { |
| 443 | + e.printStackTrace(); | ||
| 443 | dataSourceTransactionManager.rollback(transactionStatus); | 444 | dataSourceTransactionManager.rollback(transactionStatus); |
| 444 | } | 445 | } |
| 445 | return result; | 446 | return result; |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
| @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation; | @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.stereotype.Controller; | 9 | import org.springframework.stereotype.Controller; |
| 10 | import org.springframework.web.bind.annotation.CrossOrigin; | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| 11 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 11 | import org.springframework.web.bind.annotation.RequestMapping; | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | import org.springframework.web.bind.annotation.RequestParam; | 13 | import org.springframework.web.bind.annotation.RequestParam; |
| 13 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | 14 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| @@ -25,11 +26,11 @@ public class SseController { | @@ -25,11 +26,11 @@ public class SseController { | ||
| 25 | @Autowired | 26 | @Autowired |
| 26 | AlarmEventListener alarmEventListener; | 27 | AlarmEventListener alarmEventListener; |
| 27 | 28 | ||
| 28 | - @ApiOperation("设置响应") | 29 | + @ApiOperation("浏览器推送") |
| 29 | @ApiImplicitParams({ | 30 | @ApiImplicitParams({ |
| 30 | @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), | 31 | @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), |
| 31 | }) | 32 | }) |
| 32 | - @RequestMapping("/emit") | 33 | + @PostMapping("/emit") |
| 33 | public SseEmitter emit(@RequestParam String browserId) { | 34 | public SseEmitter emit(@RequestParam String browserId) { |
| 34 | final SseEmitter sseEmitter = new SseEmitter(0L); | 35 | final SseEmitter sseEmitter = new SseEmitter(0L); |
| 35 | try { | 36 | try { |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
| @@ -44,7 +44,7 @@ public class MediaController { | @@ -44,7 +44,7 @@ public class MediaController { | ||
| 44 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | 44 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| 45 | @ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class), | 45 | @ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class), |
| 46 | }) | 46 | }) |
| 47 | - @RequestMapping(value = "/getStreamInfoByAppAndStream") | 47 | + @GetMapping(value = "/stream_info_by_app_and_stream") |
| 48 | @ResponseBody | 48 | @ResponseBody |
| 49 | public StreamInfo getStreamInfoByAppAndStream(String app, String stream){ | 49 | public StreamInfo getStreamInfoByAppAndStream(String app, String stream){ |
| 50 | return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream); | 50 | return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream); |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platformGbStream/PlatformGbStreamController.java
| @@ -32,7 +32,7 @@ public class PlatformGbStreamController { | @@ -32,7 +32,7 @@ public class PlatformGbStreamController { | ||
| 32 | @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), | 32 | @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), |
| 33 | @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), | 33 | @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), |
| 34 | }) | 34 | }) |
| 35 | - @RequestMapping(value = "/list") | 35 | + @GetMapping(value = "/list") |
| 36 | @ResponseBody | 36 | @ResponseBody |
| 37 | public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, | 37 | public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, |
| 38 | @RequestParam(required = false)Integer count){ | 38 | @RequestParam(required = false)Integer count){ |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
| @@ -93,7 +93,7 @@ public class PlayController { | @@ -93,7 +93,7 @@ public class PlayController { | ||
| 93 | @ApiImplicitParams({ | 93 | @ApiImplicitParams({ |
| 94 | @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), | 94 | @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), |
| 95 | }) | 95 | }) |
| 96 | - @PostMapping("/stop/{streamId}") | 96 | + @GetMapping("/stop/{streamId}") |
| 97 | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { | 97 | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { |
| 98 | 98 | ||
| 99 | logger.debug(String.format("设备预览/回放停止API调用,streamId:%s", streamId)); | 99 | logger.debug(String.format("设备预览/回放停止API调用,streamId:%s", streamId)); |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
| @@ -105,7 +105,7 @@ public class PlaybackController { | @@ -105,7 +105,7 @@ public class PlaybackController { | ||
| 105 | @ApiImplicitParams({ | 105 | @ApiImplicitParams({ |
| 106 | @ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class), | 106 | @ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class), |
| 107 | }) | 107 | }) |
| 108 | - @RequestMapping("/stop/{ssrc}") | 108 | + @GetMapping("/stop/{ssrc}") |
| 109 | public ResponseEntity<String> playStop(@PathVariable String ssrc) { | 109 | public ResponseEntity<String> playStop(@PathVariable String ssrc) { |
| 110 | 110 | ||
| 111 | cmder.streamByeCmd(ssrc); | 111 | cmder.streamByeCmd(ssrc); |
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
| @@ -25,7 +25,7 @@ public class ServerController { | @@ -25,7 +25,7 @@ public class ServerController { | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | @ApiOperation("重启服务") | 27 | @ApiOperation("重启服务") |
| 28 | - @RequestMapping(value = "/restart") | 28 | + @GetMapping(value = "/restart") |
| 29 | @ResponseBody | 29 | @ResponseBody |
| 30 | public Object restart(){ | 30 | public Object restart(){ |
| 31 | Thread restartThread = new Thread(new Runnable() { | 31 | Thread restartThread = new Thread(new Runnable() { |
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
| @@ -41,7 +41,7 @@ public class StreamProxyController { | @@ -41,7 +41,7 @@ public class StreamProxyController { | ||
| 41 | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), | 41 | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), |
| 42 | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), | 42 | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), |
| 43 | }) | 43 | }) |
| 44 | - @RequestMapping(value = "/list") | 44 | + @GetMapping(value = "/list") |
| 45 | @ResponseBody | 45 | @ResponseBody |
| 46 | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, | 46 | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, |
| 47 | @RequestParam(required = false)Integer count, | 47 | @RequestParam(required = false)Integer count, |
| @@ -55,7 +55,7 @@ public class StreamProxyController { | @@ -55,7 +55,7 @@ public class StreamProxyController { | ||
| 55 | @ApiImplicitParams({ | 55 | @ApiImplicitParams({ |
| 56 | @ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class), | 56 | @ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class), |
| 57 | }) | 57 | }) |
| 58 | - @RequestMapping(value = "/save") | 58 | + @PostMapping(value = "/save") |
| 59 | @ResponseBody | 59 | @ResponseBody |
| 60 | public Object save(@RequestBody StreamProxyItem param){ | 60 | public Object save(@RequestBody StreamProxyItem param){ |
| 61 | logger.info("添加代理: " + JSONObject.toJSONString(param)); | 61 | logger.info("添加代理: " + JSONObject.toJSONString(param)); |
| @@ -68,7 +68,7 @@ public class StreamProxyController { | @@ -68,7 +68,7 @@ public class StreamProxyController { | ||
| 68 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | 68 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| 69 | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), | 69 | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| 70 | }) | 70 | }) |
| 71 | - @RequestMapping(value = "/del") | 71 | + @DeleteMapping(value = "/del") |
| 72 | @ResponseBody | 72 | @ResponseBody |
| 73 | public Object del(String app, String stream){ | 73 | public Object del(String app, String stream){ |
| 74 | logger.info("移除代理: " + app + "/" + stream); | 74 | logger.info("移除代理: " + app + "/" + stream); |
| @@ -81,7 +81,7 @@ public class StreamProxyController { | @@ -81,7 +81,7 @@ public class StreamProxyController { | ||
| 81 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | 81 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| 82 | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), | 82 | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| 83 | }) | 83 | }) |
| 84 | - @RequestMapping(value = "/start") | 84 | + @GetMapping(value = "/start") |
| 85 | @ResponseBody | 85 | @ResponseBody |
| 86 | public Object start(String app, String stream){ | 86 | public Object start(String app, String stream){ |
| 87 | logger.info("启用代理: " + app + "/" + stream); | 87 | logger.info("启用代理: " + app + "/" + stream); |
| @@ -94,11 +94,11 @@ public class StreamProxyController { | @@ -94,11 +94,11 @@ public class StreamProxyController { | ||
| 94 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | 94 | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| 95 | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), | 95 | @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), |
| 96 | }) | 96 | }) |
| 97 | - @RequestMapping(value = "/stop") | 97 | + @GetMapping(value = "/stop") |
| 98 | @ResponseBody | 98 | @ResponseBody |
| 99 | public Object stop(String app, String stream){ | 99 | public Object stop(String app, String stream){ |
| 100 | logger.info("停用代理: " + app + "/" + stream); | 100 | logger.info("停用代理: " + app + "/" + stream); |
| 101 | boolean result = streamProxyService.stop(app, stream); | 101 | boolean result = streamProxyService.stop(app, stream); |
| 102 | - return "success"; | 102 | + return result?"success":"fail"; |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
| @@ -32,7 +32,7 @@ public class StreamPushController { | @@ -32,7 +32,7 @@ public class StreamPushController { | ||
| 32 | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), | 32 | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), |
| 33 | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), | 33 | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), |
| 34 | }) | 34 | }) |
| 35 | - @RequestMapping(value = "/list") | 35 | + @GetMapping(value = "/list") |
| 36 | @ResponseBody | 36 | @ResponseBody |
| 37 | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, | 37 | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, |
| 38 | @RequestParam(required = false)Integer count, | 38 | @RequestParam(required = false)Integer count, |
| @@ -47,7 +47,7 @@ public class StreamPushController { | @@ -47,7 +47,7 @@ public class StreamPushController { | ||
| 47 | @ApiImplicitParams({ | 47 | @ApiImplicitParams({ |
| 48 | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), | 48 | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), |
| 49 | }) | 49 | }) |
| 50 | - @RequestMapping(value = "/save_to_gb") | 50 | + @PostMapping(value = "/save_to_gb") |
| 51 | @ResponseBody | 51 | @ResponseBody |
| 52 | public Object saveToGB(@RequestBody GbStream stream){ | 52 | public Object saveToGB(@RequestBody GbStream stream){ |
| 53 | if (streamPushService.saveToGB(stream)){ | 53 | if (streamPushService.saveToGB(stream)){ |
| @@ -62,7 +62,7 @@ public class StreamPushController { | @@ -62,7 +62,7 @@ public class StreamPushController { | ||
| 62 | @ApiImplicitParams({ | 62 | @ApiImplicitParams({ |
| 63 | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), | 63 | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), |
| 64 | }) | 64 | }) |
| 65 | - @RequestMapping(value = "/remove_form_gb") | 65 | + @DeleteMapping(value = "/remove_form_gb") |
| 66 | @ResponseBody | 66 | @ResponseBody |
| 67 | public Object removeFormGB(@RequestBody GbStream stream){ | 67 | public Object removeFormGB(@RequestBody GbStream stream){ |
| 68 | if (streamPushService.removeFromGB(stream)){ | 68 | if (streamPushService.removeFromGB(stream)){ |
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
| @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation; | @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation; | ||
| 8 | import org.springframework.beans.factory.annotation.Value; | 8 | import org.springframework.beans.factory.annotation.Value; |
| 9 | import org.springframework.util.StringUtils; | 9 | import org.springframework.util.StringUtils; |
| 10 | import org.springframework.web.bind.annotation.CrossOrigin; | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| 11 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 11 | import org.springframework.web.bind.annotation.RequestMapping; | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | import org.springframework.web.bind.annotation.RestController; | 13 | import org.springframework.web.bind.annotation.RestController; |
| 13 | 14 | ||
| @@ -28,7 +29,7 @@ public class UserController { | @@ -28,7 +29,7 @@ public class UserController { | ||
| 28 | @ApiImplicitParam(name = "username", value = "用户名", dataTypeClass = String.class), | 29 | @ApiImplicitParam(name = "username", value = "用户名", dataTypeClass = String.class), |
| 29 | @ApiImplicitParam(name = "password", value = "密码(32未md5加密)", dataTypeClass = String.class), | 30 | @ApiImplicitParam(name = "password", value = "密码(32未md5加密)", dataTypeClass = String.class), |
| 30 | }) | 31 | }) |
| 31 | - @RequestMapping("/login") | 32 | + @GetMapping("/login") |
| 32 | public String login(String username, String password){ | 33 | public String login(String username, String password){ |
| 33 | if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) | 34 | if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) |
| 34 | && !StringUtils.isEmpty(password) && password.equals(passwordConfig)) { | 35 | && !StringUtils.isEmpty(password) && password.equals(passwordConfig)) { |
web_src/src/components/DeviceList.vue
| @@ -136,20 +136,20 @@ | @@ -136,20 +136,20 @@ | ||
| 136 | getDeviceList: function() { | 136 | getDeviceList: function() { |
| 137 | let that = this; | 137 | let that = this; |
| 138 | this.getDeviceListLoading = true; | 138 | this.getDeviceListLoading = true; |
| 139 | - this.$axios.get(`/api/device/query/devices`,{ | 139 | + this.$axios({ |
| 140 | + method: 'get', | ||
| 141 | + url:`/api/device/query/devices`, | ||
| 140 | params: { | 142 | params: { |
| 141 | page: that.currentPage, | 143 | page: that.currentPage, |
| 142 | count: that.count | 144 | count: that.count |
| 143 | } | 145 | } |
| 144 | - } ) | ||
| 145 | - .then(function (res) { | 146 | + }).then(function (res) { |
| 146 | console.log(res); | 147 | console.log(res); |
| 147 | console.log(res.data.list); | 148 | console.log(res.data.list); |
| 148 | that.total = res.data.total; | 149 | that.total = res.data.total; |
| 149 | that.deviceList = res.data.list; | 150 | that.deviceList = res.data.list; |
| 150 | that.getDeviceListLoading = false; | 151 | that.getDeviceListLoading = false; |
| 151 | - }) | ||
| 152 | - .catch(function (error) { | 152 | + }).catch(function (error) { |
| 153 | console.log(error); | 153 | console.log(error); |
| 154 | that.getDeviceListLoading = false; | 154 | that.getDeviceListLoading = false; |
| 155 | }); | 155 | }); |
web_src/src/components/Login.vue
| @@ -61,10 +61,11 @@ export default { | @@ -61,10 +61,11 @@ export default { | ||
| 61 | //设置在登录状态 | 61 | //设置在登录状态 |
| 62 | this.isLoging = true; | 62 | this.isLoging = true; |
| 63 | 63 | ||
| 64 | - this.$axios.get("/api/user/login",{ | ||
| 65 | - params: loginParam | ||
| 66 | - } ) | ||
| 67 | - .then(function (res) { | 64 | + this.$axios({ |
| 65 | + method: 'get', | ||
| 66 | + url:"/api/user/login", | ||
| 67 | + params: loginParam | ||
| 68 | + }).then(function (res) { | ||
| 68 | console.log(JSON.stringify(res)); | 69 | console.log(JSON.stringify(res)); |
| 69 | if (res.data == "success") { | 70 | if (res.data == "success") { |
| 70 | that.$cookies.set("session", {"username": that.username}) ; | 71 | that.$cookies.set("session", {"username": that.username}) ; |
| @@ -79,8 +80,7 @@ export default { | @@ -79,8 +80,7 @@ export default { | ||
| 79 | type: 'error' | 80 | type: 'error' |
| 80 | }); | 81 | }); |
| 81 | } | 82 | } |
| 82 | - }) | ||
| 83 | - .catch(function (error) { | 83 | + }).catch(function (error) { |
| 84 | that.$message.error(error.response.statusText); | 84 | that.$message.error(error.response.statusText); |
| 85 | that.isLoging = false; | 85 | that.isLoging = false; |
| 86 | }); | 86 | }); |
web_src/src/components/ParentPlatformList.vue
| @@ -121,20 +121,21 @@ export default { | @@ -121,20 +121,21 @@ export default { | ||
| 121 | }, | 121 | }, |
| 122 | deletePlatformCommit: function(platform) { | 122 | deletePlatformCommit: function(platform) { |
| 123 | var that = this; | 123 | var that = this; |
| 124 | - that.$axios.delete(`/api/platform/delete/${platform.serverGBId}`) | ||
| 125 | - .then(function (res) { | ||
| 126 | - if (res.data == "success") { | ||
| 127 | - that.$message({ | ||
| 128 | - showClose: true, | ||
| 129 | - message: '删除成功', | ||
| 130 | - type: 'success' | ||
| 131 | - }); | ||
| 132 | - that.initData() | ||
| 133 | - } | ||
| 134 | - }) | ||
| 135 | - .catch(function (error) { | ||
| 136 | - console.log(error); | ||
| 137 | - }); | 124 | + that.$axios({ |
| 125 | + method: 'delete', | ||
| 126 | + url:`/api/platform/delete/${platform.serverGBId}` | ||
| 127 | + }).then(function (res) { | ||
| 128 | + if (res.data == "success") { | ||
| 129 | + that.$message({ | ||
| 130 | + showClose: true, | ||
| 131 | + message: '删除成功', | ||
| 132 | + type: 'success' | ||
| 133 | + }); | ||
| 134 | + that.initData() | ||
| 135 | + } | ||
| 136 | + }).catch(function (error) { | ||
| 137 | + console.log(error); | ||
| 138 | + }); | ||
| 138 | }, | 139 | }, |
| 139 | chooseChannel: function(platform) { | 140 | chooseChannel: function(platform) { |
| 140 | this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, ()=>{ | 141 | this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, ()=>{ |
| @@ -155,14 +156,15 @@ export default { | @@ -155,14 +156,15 @@ export default { | ||
| 155 | getPlatformList: function() { | 156 | getPlatformList: function() { |
| 156 | let that = this; | 157 | let that = this; |
| 157 | 158 | ||
| 158 | - this.$axios.get(`/api/platform/query/${that.count}/${that.currentPage}`) | ||
| 159 | - .then(function (res) { | ||
| 160 | - that.total = res.data.total; | ||
| 161 | - that.platformList = res.data.list; | ||
| 162 | - }) | ||
| 163 | - .catch(function (error) { | ||
| 164 | - console.log(error); | ||
| 165 | - }); | 159 | + this.$axios({ |
| 160 | + method: 'get', | ||
| 161 | + url:`/api/platform/query/${that.count}/${that.currentPage}` | ||
| 162 | + }).then(function (res) { | ||
| 163 | + that.total = res.data.total; | ||
| 164 | + that.platformList = res.data.list; | ||
| 165 | + }).catch(function (error) { | ||
| 166 | + console.log(error); | ||
| 167 | + }); | ||
| 166 | 168 | ||
| 167 | } | 169 | } |
| 168 | 170 |
web_src/src/components/PushVideoList.vue
| @@ -107,20 +107,20 @@ | @@ -107,20 +107,20 @@ | ||
| 107 | getPushList: function() { | 107 | getPushList: function() { |
| 108 | let that = this; | 108 | let that = this; |
| 109 | this.getDeviceListLoading = true; | 109 | this.getDeviceListLoading = true; |
| 110 | - this.$axios.get(`/api/push/list`,{ | 110 | + this.$axios({ |
| 111 | + method: 'get', | ||
| 112 | + url:`/api/push/list`, | ||
| 111 | params: { | 113 | params: { |
| 112 | page: that.currentPage, | 114 | page: that.currentPage, |
| 113 | count: that.count | 115 | count: that.count |
| 114 | } | 116 | } |
| 115 | - } ) | ||
| 116 | - .then(function (res) { | 117 | + }).then(function (res) { |
| 117 | console.log(res); | 118 | console.log(res); |
| 118 | console.log(res.data.list); | 119 | console.log(res.data.list); |
| 119 | that.total = res.data.total; | 120 | that.total = res.data.total; |
| 120 | that.pushList = res.data.list; | 121 | that.pushList = res.data.list; |
| 121 | that.getDeviceListLoading = false; | 122 | that.getDeviceListLoading = false; |
| 122 | - }) | ||
| 123 | - .catch(function (error) { | 123 | + }).catch(function (error) { |
| 124 | console.log(error); | 124 | console.log(error); |
| 125 | that.getDeviceListLoading = false; | 125 | that.getDeviceListLoading = false; |
| 126 | }); | 126 | }); |
| @@ -129,20 +129,20 @@ | @@ -129,20 +129,20 @@ | ||
| 129 | playPuhsh: function(row){ | 129 | playPuhsh: function(row){ |
| 130 | let that = this; | 130 | let that = this; |
| 131 | this.getListLoading = true; | 131 | this.getListLoading = true; |
| 132 | - this.$axios.get(`/api/media/getStreamInfoByAppAndStream`,{ | 132 | + this.$axios({ |
| 133 | + method: 'get', | ||
| 134 | + url:`/api/media/stream_info_by_app_and_stream`, | ||
| 133 | params: { | 135 | params: { |
| 134 | app: row.app, | 136 | app: row.app, |
| 135 | stream: row.stream | 137 | stream: row.stream |
| 136 | } | 138 | } |
| 137 | - }) | ||
| 138 | - .then(function (res) { | 139 | + }).then(function (res) { |
| 139 | that.getListLoading = false; | 140 | that.getListLoading = false; |
| 140 | that.$refs.devicePlayer.openDialog("streamPlay", null, null, { | 141 | that.$refs.devicePlayer.openDialog("streamPlay", null, null, { |
| 141 | streamInfo: res.data, | 142 | streamInfo: res.data, |
| 142 | hasAudio: true | 143 | hasAudio: true |
| 143 | }); | 144 | }); |
| 144 | - }) | ||
| 145 | - .catch(function (error) { | 145 | + }).catch(function (error) { |
| 146 | console.log(error); | 146 | console.log(error); |
| 147 | that.getListLoading = false; | 147 | that.getListLoading = false; |
| 148 | }); | 148 | }); |
| @@ -155,17 +155,17 @@ | @@ -155,17 +155,17 @@ | ||
| 155 | }, | 155 | }, |
| 156 | removeFromGB: function(row){ | 156 | removeFromGB: function(row){ |
| 157 | var that = this; | 157 | var that = this; |
| 158 | - that.$axios.post(`/api/push/remove_form_gb`, row) | ||
| 159 | - .then(function (res) { | ||
| 160 | - console.log(res); | ||
| 161 | - console.log(res.data == "success"); | ||
| 162 | - if (res.data == "success") { | 158 | + that.$axios({ |
| 159 | + method:"delete", | ||
| 160 | + url:"/api/push/remove_form_gb", | ||
| 161 | + data:row | ||
| 162 | + }).then((res)=>{ | ||
| 163 | + if (res.data == "success") { | ||
| 163 | that.initData() | 164 | that.initData() |
| 164 | } | 165 | } |
| 165 | - }) | ||
| 166 | - .catch(function (error) { | ||
| 167 | - console.log(error); | ||
| 168 | - }); | 166 | + }).catch(function (error) { |
| 167 | + console.log(error); | ||
| 168 | + }); | ||
| 169 | }, | 169 | }, |
| 170 | dateFormat: function(/** timestamp=0 **/) { | 170 | dateFormat: function(/** timestamp=0 **/) { |
| 171 | var ts = arguments[0] || 0; | 171 | var ts = arguments[0] || 0; |
web_src/src/components/StreamProxyList.vue
| @@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
| 62 | <el-button-group> | 62 | <el-button-group> |
| 63 | <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.enable" @click="play(scope.row)">播放</el-button> | 63 | <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.enable" @click="play(scope.row)">播放</el-button> |
| 64 | <el-button size="mini" icon="el-icon-close" type="success" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button> | 64 | <el-button size="mini" icon="el-icon-close" type="success" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button> |
| 65 | - <el-button size="mini" icon="el-icon-check" type="primary" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button> | 65 | + <el-button size="mini" icon="el-icon-check" type="primary" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button> |
| 66 | <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteStreamProxy(scope.row)">删除</el-button> | 66 | <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteStreamProxy(scope.row)">删除</el-button> |
| 67 | </el-button-group> | 67 | </el-button-group> |
| 68 | </template> | 68 | </template> |
| @@ -105,7 +105,8 @@ | @@ -105,7 +105,8 @@ | ||
| 105 | currentPage:1, | 105 | currentPage:1, |
| 106 | count:15, | 106 | count:15, |
| 107 | total:0, | 107 | total:0, |
| 108 | - getListLoading: false | 108 | + getListLoading: false, |
| 109 | + startBtnLaoding: false | ||
| 109 | }; | 110 | }; |
| 110 | }, | 111 | }, |
| 111 | computed: { | 112 | computed: { |
| @@ -133,20 +134,20 @@ | @@ -133,20 +134,20 @@ | ||
| 133 | getStreamProxyList: function() { | 134 | getStreamProxyList: function() { |
| 134 | let that = this; | 135 | let that = this; |
| 135 | this.getListLoading = true; | 136 | this.getListLoading = true; |
| 136 | - this.$axios.get(`/api/proxy/list`,{ | 137 | + this.$axios({ |
| 138 | + method: 'get', | ||
| 139 | + url:`/api/proxy/list`, | ||
| 137 | params: { | 140 | params: { |
| 138 | page: that.currentPage, | 141 | page: that.currentPage, |
| 139 | count: that.count | 142 | count: that.count |
| 140 | } | 143 | } |
| 141 | - } ) | ||
| 142 | - .then(function (res) { | 144 | + }).then(function (res) { |
| 143 | console.log(res); | 145 | console.log(res); |
| 144 | console.log(res.data.list); | 146 | console.log(res.data.list); |
| 145 | that.total = res.data.total; | 147 | that.total = res.data.total; |
| 146 | that.streamProxyList = res.data.list; | 148 | that.streamProxyList = res.data.list; |
| 147 | that.getListLoading = false; | 149 | that.getListLoading = false; |
| 148 | - }) | ||
| 149 | - .catch(function (error) { | 150 | + }).catch(function (error) { |
| 150 | console.log(error); | 151 | console.log(error); |
| 151 | that.getListLoading = false; | 152 | that.getListLoading = false; |
| 152 | }); | 153 | }); |
| @@ -159,20 +160,20 @@ | @@ -159,20 +160,20 @@ | ||
| 159 | play: function(row){ | 160 | play: function(row){ |
| 160 | let that = this; | 161 | let that = this; |
| 161 | this.getListLoading = true; | 162 | this.getListLoading = true; |
| 162 | - this.$axios.get(`/api/media/getStreamInfoByAppAndStream`,{ | 163 | + this.$axios({ |
| 164 | + method: 'get', | ||
| 165 | + url:`/api/media/stream_info_by_app_and_stream`, | ||
| 163 | params: { | 166 | params: { |
| 164 | app: row.app, | 167 | app: row.app, |
| 165 | stream: row.stream | 168 | stream: row.stream |
| 166 | } | 169 | } |
| 167 | - }) | ||
| 168 | - .then(function (res) { | 170 | + }).then(function (res) { |
| 169 | that.getListLoading = false; | 171 | that.getListLoading = false; |
| 170 | that.$refs.devicePlayer.openDialog("streamPlay", null, null, { | 172 | that.$refs.devicePlayer.openDialog("streamPlay", null, null, { |
| 171 | streamInfo: res.data, | 173 | streamInfo: res.data, |
| 172 | hasAudio: true | 174 | hasAudio: true |
| 173 | }); | 175 | }); |
| 174 | - }) | ||
| 175 | - .catch(function (error) { | 176 | + }).catch(function (error) { |
| 176 | console.log(error); | 177 | console.log(error); |
| 177 | that.getListLoading = false; | 178 | that.getListLoading = false; |
| 178 | }); | 179 | }); |
| @@ -182,53 +183,56 @@ | @@ -182,53 +183,56 @@ | ||
| 182 | console.log(1111) | 183 | console.log(1111) |
| 183 | let that = this; | 184 | let that = this; |
| 184 | this.getListLoading = true; | 185 | this.getListLoading = true; |
| 185 | - this.$axios.get(`/api/proxy/del`,{ | ||
| 186 | - params: { | 186 | + that.$axios({ |
| 187 | + method:"delete", | ||
| 188 | + url:"/api/proxy/del", | ||
| 189 | + params:{ | ||
| 187 | app: row.app, | 190 | app: row.app, |
| 188 | stream: row.stream | 191 | stream: row.stream |
| 189 | } | 192 | } |
| 190 | - }) | ||
| 191 | - .then(function (res) { | ||
| 192 | - that.getListLoading = false; | 193 | + }).then((res)=>{ |
| 194 | + that.getListLoading = false; | ||
| 193 | that.initData() | 195 | that.initData() |
| 194 | - }) | ||
| 195 | - .catch(function (error) { | ||
| 196 | - console.log(error); | 196 | + }).catch(function (error) { |
| 197 | + console.log(error); | ||
| 197 | that.getListLoading = false; | 198 | that.getListLoading = false; |
| 198 | - }); | 199 | + }); |
| 199 | }, | 200 | }, |
| 200 | start: function(row){ | 201 | start: function(row){ |
| 201 | let that = this; | 202 | let that = this; |
| 202 | this.getListLoading = true; | 203 | this.getListLoading = true; |
| 203 | - this.$axios.get(`/api/proxy/start`,{ | 204 | + this.startBtnLaoding = true; |
| 205 | + this.$axios({ | ||
| 206 | + method: 'get', | ||
| 207 | + url:`/api/proxy/start`, | ||
| 204 | params: { | 208 | params: { |
| 205 | app: row.app, | 209 | app: row.app, |
| 206 | stream: row.stream | 210 | stream: row.stream |
| 207 | } | 211 | } |
| 208 | - }) | ||
| 209 | - .then(function (res) { | 212 | + }).then(function (res) { |
| 210 | that.getListLoading = false; | 213 | that.getListLoading = false; |
| 214 | + that.startBtnLaoding = false; | ||
| 211 | that.initData() | 215 | that.initData() |
| 212 | - }) | ||
| 213 | - .catch(function (error) { | 216 | + }).catch(function (error) { |
| 214 | console.log(error); | 217 | console.log(error); |
| 215 | that.getListLoading = false; | 218 | that.getListLoading = false; |
| 219 | + that.startBtnLaoding = false; | ||
| 216 | }); | 220 | }); |
| 217 | }, | 221 | }, |
| 218 | stop: function(row){ | 222 | stop: function(row){ |
| 219 | let that = this; | 223 | let that = this; |
| 220 | this.getListLoading = true; | 224 | this.getListLoading = true; |
| 221 | - this.$axios.get(`/api/proxy/stop`,{ | 225 | + this.$axios({ |
| 226 | + method: 'get', | ||
| 227 | + url:`/api/proxy/stop`, | ||
| 222 | params: { | 228 | params: { |
| 223 | app: row.app, | 229 | app: row.app, |
| 224 | stream: row.stream | 230 | stream: row.stream |
| 225 | } | 231 | } |
| 226 | - }) | ||
| 227 | - .then(function (res) { | 232 | + }).then(function (res) { |
| 228 | that.getListLoading = false; | 233 | that.getListLoading = false; |
| 229 | that.initData() | 234 | that.initData() |
| 230 | - }) | ||
| 231 | - .catch(function (error) { | 235 | + }).catch(function (error) { |
| 232 | console.log(error); | 236 | console.log(error); |
| 233 | that.getListLoading = false; | 237 | that.getListLoading = false; |
| 234 | }); | 238 | }); |
web_src/src/components/channelList.vue
| @@ -153,17 +153,17 @@ export default { | @@ -153,17 +153,17 @@ export default { | ||
| 153 | }, | 153 | }, |
| 154 | getDeviceChannelList: function () { | 154 | getDeviceChannelList: function () { |
| 155 | let that = this; | 155 | let that = this; |
| 156 | - | ||
| 157 | - this.$axios.get(`/api/device/query/devices/${this.$route.params.deviceId}/channels`, { | ||
| 158 | - params: { | ||
| 159 | - page: that.currentPage, | 156 | + this.$axios({ |
| 157 | + method: 'get', | ||
| 158 | + url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`, | ||
| 159 | + params:{ | ||
| 160 | + page: that.currentPage, | ||
| 160 | count: that.count, | 161 | count: that.count, |
| 161 | query: that.searchSrt, | 162 | query: that.searchSrt, |
| 162 | online: that.online, | 163 | online: that.online, |
| 163 | channelType: that.channelType | 164 | channelType: that.channelType |
| 164 | - } | ||
| 165 | - }) | ||
| 166 | - .then(function (res) { | 165 | + } |
| 166 | + }).then(function (res) { | ||
| 167 | console.log(res); | 167 | console.log(res); |
| 168 | that.total = res.data.total; | 168 | that.total = res.data.total; |
| 169 | that.deviceChannelList = res.data.list; | 169 | that.deviceChannelList = res.data.list; |
| @@ -171,10 +171,10 @@ export default { | @@ -171,10 +171,10 @@ export default { | ||
| 171 | that.$nextTick(() => { | 171 | that.$nextTick(() => { |
| 172 | that.$refs.channelListTable.doLayout(); | 172 | that.$refs.channelListTable.doLayout(); |
| 173 | }) | 173 | }) |
| 174 | - }) | ||
| 175 | - .catch(function (error) { | ||
| 176 | - console.log(error); | ||
| 177 | - }); | 174 | + }).catch(function (error) { |
| 175 | + console.log(error); | ||
| 176 | + }); | ||
| 177 | + | ||
| 178 | 178 | ||
| 179 | }, | 179 | }, |
| 180 | 180 | ||
| @@ -215,7 +215,7 @@ export default { | @@ -215,7 +215,7 @@ export default { | ||
| 215 | console.log(itemData) | 215 | console.log(itemData) |
| 216 | var that = this; | 216 | var that = this; |
| 217 | this.$axios({ | 217 | this.$axios({ |
| 218 | - method: 'post', | 218 | + method: 'get', |
| 219 | url: '/api/play/stop/' + itemData.streamId | 219 | url: '/api/play/stop/' + itemData.streamId |
| 220 | }).then(function (res) { | 220 | }).then(function (res) { |
| 221 | console.log(JSON.stringify(res)); | 221 | console.log(JSON.stringify(res)); |
| @@ -251,26 +251,26 @@ export default { | @@ -251,26 +251,26 @@ export default { | ||
| 251 | showSubchannels: function (channelId) { | 251 | showSubchannels: function (channelId) { |
| 252 | let that = this; | 252 | let that = this; |
| 253 | 253 | ||
| 254 | - this.$axios.get(`/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, { | ||
| 255 | - params: { | ||
| 256 | - page: that.currentPage, | ||
| 257 | - count: that.count, | ||
| 258 | - query: that.searchSrt, | ||
| 259 | - online: that.online, | ||
| 260 | - channelType: that.channelType | ||
| 261 | - } | ||
| 262 | - }) | ||
| 263 | - .then(function (res) { | ||
| 264 | - that.total = res.data.total; | ||
| 265 | - that.deviceChannelList = res.data.list; | ||
| 266 | - // 防止出现表格错位 | ||
| 267 | - that.$nextTick(() => { | ||
| 268 | - that.$refs.channelListTable.doLayout(); | ||
| 269 | - }) | 254 | + this.$axios({ |
| 255 | + method: 'get', | ||
| 256 | + url:`/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, | ||
| 257 | + params: { | ||
| 258 | + page: that.currentPage, | ||
| 259 | + count: that.count, | ||
| 260 | + query: that.searchSrt, | ||
| 261 | + online: that.online, | ||
| 262 | + channelType: that.channelType | ||
| 263 | + } | ||
| 264 | + }).then(function (res) { | ||
| 265 | + that.total = res.data.total; | ||
| 266 | + that.deviceChannelList = res.data.list; | ||
| 267 | + // 防止出现表格错位 | ||
| 268 | + that.$nextTick(() => { | ||
| 269 | + that.$refs.channelListTable.doLayout(); | ||
| 270 | }) | 270 | }) |
| 271 | - .catch(function (error) { | ||
| 272 | - console.log(error); | ||
| 273 | - }); | 271 | + }).catch(function (error) { |
| 272 | + console.log(error); | ||
| 273 | + }); | ||
| 274 | }, | 274 | }, |
| 275 | search: function () { | 275 | search: function () { |
| 276 | console.log(this.searchSrt) | 276 | console.log(this.searchSrt) |
web_src/src/components/devicePosition.vue
| @@ -171,13 +171,14 @@ export default { | @@ -171,13 +171,14 @@ export default { | ||
| 171 | this.endTime = null; | 171 | this.endTime = null; |
| 172 | } | 172 | } |
| 173 | let self = this; | 173 | let self = this; |
| 174 | - this.$axios.get(`/api/position/history/${this.deviceId}`, { | 174 | + this.$axios({ |
| 175 | + method: 'get', | ||
| 176 | + url:`/api/position/history/${this.deviceId}`, | ||
| 175 | params: { | 177 | params: { |
| 176 | start: self.startTime, | 178 | start: self.startTime, |
| 177 | end: self.endTime, | 179 | end: self.endTime, |
| 178 | }, | 180 | }, |
| 179 | - }) | ||
| 180 | - .then(function (res) { | 181 | + }).then(function (res) { |
| 181 | self.total = res.data.length; | 182 | self.total = res.data.length; |
| 182 | self.mobilePositionList = res.data; | 183 | self.mobilePositionList = res.data; |
| 183 | console.log(self.mobilePositionList); | 184 | console.log(self.mobilePositionList); |
| @@ -192,8 +193,7 @@ export default { | @@ -192,8 +193,7 @@ export default { | ||
| 192 | self.showMarkPoints(self); | 193 | self.showMarkPoints(self); |
| 193 | }); | 194 | }); |
| 194 | } | 195 | } |
| 195 | - }) | ||
| 196 | - .catch(function (error) { | 196 | + }).catch(function (error) { |
| 197 | console.log(error); | 197 | console.log(error); |
| 198 | }); | 198 | }); |
| 199 | }, | 199 | }, |
| @@ -202,8 +202,10 @@ export default { | @@ -202,8 +202,10 @@ export default { | ||
| 202 | this.mapPointList = []; | 202 | this.mapPointList = []; |
| 203 | this.mobilePositionList = []; | 203 | this.mobilePositionList = []; |
| 204 | let self = this; | 204 | let self = this; |
| 205 | - this.$axios.get(`/api/position/latest/${this.deviceId}`) | ||
| 206 | - .then(function (res) { | 205 | + this.$axios({ |
| 206 | + method: 'get', | ||
| 207 | + url:`/api/position/latest/${this.deviceId}` | ||
| 208 | + }).then(function (res) { | ||
| 207 | console.log(res.data); | 209 | console.log(res.data); |
| 208 | self.total = res.data.length; | 210 | self.total = res.data.length; |
| 209 | self.mobilePositionList.push(res.data); | 211 | self.mobilePositionList.push(res.data); |
| @@ -219,20 +221,20 @@ export default { | @@ -219,20 +221,20 @@ export default { | ||
| 219 | self.showMarkPoints(self); | 221 | self.showMarkPoints(self); |
| 220 | }); | 222 | }); |
| 221 | } | 223 | } |
| 222 | - }) | ||
| 223 | - .catch(function (error) { | 224 | + }).catch(function (error) { |
| 224 | console.log(error); | 225 | console.log(error); |
| 225 | }); | 226 | }); |
| 226 | }, | 227 | }, |
| 227 | subscribeMobilePosition: function() { | 228 | subscribeMobilePosition: function() { |
| 228 | let self = this; | 229 | let self = this; |
| 229 | - this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { | ||
| 230 | - params: { | ||
| 231 | - expires: self.expired, | ||
| 232 | - interval: self.interval, | ||
| 233 | - }, | ||
| 234 | - }) | ||
| 235 | - .then(function (res) { | 230 | + this.$axios({ |
| 231 | + method: 'get', | ||
| 232 | + url:`/api/position/subscribe/${this.deviceId}`, | ||
| 233 | + params: { | ||
| 234 | + expires: self.expired, | ||
| 235 | + interval: self.interval, | ||
| 236 | + }, | ||
| 237 | + }).then(function (res) { | ||
| 236 | console.log(res.data); | 238 | console.log(res.data); |
| 237 | }) | 239 | }) |
| 238 | .catch(function (error) { | 240 | .catch(function (error) { |
| @@ -241,16 +243,17 @@ export default { | @@ -241,16 +243,17 @@ export default { | ||
| 241 | }, | 243 | }, |
| 242 | unSubscribeMobilePosition: function() { | 244 | unSubscribeMobilePosition: function() { |
| 243 | let self = this; | 245 | let self = this; |
| 244 | - this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { | ||
| 245 | - params: { | ||
| 246 | - expires: 0, | ||
| 247 | - interval: self.interval, | ||
| 248 | - }, | 246 | + this.$axios({ |
| 247 | + method: 'get', | ||
| 248 | + url:`/api/position/subscribe/${this.deviceId}`, | ||
| 249 | + params: { | ||
| 250 | + expires: 0, | ||
| 251 | + interval: self.interval, | ||
| 252 | + }, | ||
| 249 | }) | 253 | }) |
| 250 | .then(function (res) { | 254 | .then(function (res) { |
| 251 | console.log(res.data); | 255 | console.log(res.data); |
| 252 | - }) | ||
| 253 | - .catch(function (error) { | 256 | + }).catch(function (error) { |
| 254 | console.log(error); | 257 | console.log(error); |
| 255 | }); | 258 | }); |
| 256 | }, | 259 | }, |
web_src/src/components/dialog/StreamProxyEdit.vue
| @@ -146,9 +146,11 @@ export default { | @@ -146,9 +146,11 @@ export default { | ||
| 146 | onSubmit: function () { | 146 | onSubmit: function () { |
| 147 | console.log("onSubmit"); | 147 | console.log("onSubmit"); |
| 148 | var that = this; | 148 | var that = this; |
| 149 | - that.$axios | ||
| 150 | - .post(`/api/proxy/save`, that.proxyParam) | ||
| 151 | - .then(function (res) { | 149 | + that.$axios({ |
| 150 | + method: 'post', | ||
| 151 | + url:`/api/proxy/save`, | ||
| 152 | + data: that.proxyParam | ||
| 153 | + }).then(function (res) { | ||
| 152 | console.log(res); | 154 | console.log(res); |
| 153 | console.log(res.data == "success"); | 155 | console.log(res.data == "success"); |
| 154 | if (res.data == "success") { | 156 | if (res.data == "success") { |
| @@ -162,8 +164,7 @@ export default { | @@ -162,8 +164,7 @@ export default { | ||
| 162 | that.listChangeCallback(); | 164 | that.listChangeCallback(); |
| 163 | } | 165 | } |
| 164 | } | 166 | } |
| 165 | - }) | ||
| 166 | - .catch(function (error) { | 167 | + }).catch(function (error) { |
| 167 | console.log(error); | 168 | console.log(error); |
| 168 | }); | 169 | }); |
| 169 | }, | 170 | }, |
| @@ -175,14 +176,14 @@ export default { | @@ -175,14 +176,14 @@ export default { | ||
| 175 | deviceGBIdExit: async function (deviceGbId) { | 176 | deviceGBIdExit: async function (deviceGbId) { |
| 176 | var result = false; | 177 | var result = false; |
| 177 | var that = this; | 178 | var that = this; |
| 178 | - await that.$axios | ||
| 179 | - .post(`/api/platform/exit/${deviceGbId}`) | ||
| 180 | - .then(function (res) { | ||
| 181 | - result = res.data; | ||
| 182 | - }) | ||
| 183 | - .catch(function (error) { | ||
| 184 | - console.log(error); | ||
| 185 | - }); | 179 | + await that.$axios({ |
| 180 | + method: 'post', | ||
| 181 | + url:`/api/platform/exit/${deviceGbId}` | ||
| 182 | + }).then(function (res) { | ||
| 183 | + result = res.data; | ||
| 184 | + }).catch(function (error) { | ||
| 185 | + console.log(error); | ||
| 186 | + }); | ||
| 186 | return result; | 187 | return result; |
| 187 | }, | 188 | }, |
| 188 | checkExpires: function() { | 189 | checkExpires: function() { |
web_src/src/components/dialog/addStreamTOGB.vue
| @@ -89,11 +89,11 @@ export default { | @@ -89,11 +89,11 @@ export default { | ||
| 89 | onSubmit: function () { | 89 | onSubmit: function () { |
| 90 | console.log("onSubmit"); | 90 | console.log("onSubmit"); |
| 91 | var that = this; | 91 | var that = this; |
| 92 | - that.$axios | ||
| 93 | - .post(`/api/push/save_to_gb`, that.proxyParam) | ||
| 94 | - .then(function (res) { | ||
| 95 | - console.log(res); | ||
| 96 | - console.log(res.data == "success"); | 92 | + that.$axios({ |
| 93 | + method:"post", | ||
| 94 | + url:`/api/push/save_to_gb`, | ||
| 95 | + data: that.proxyParam | ||
| 96 | + }).then(function (res) { | ||
| 97 | if (res.data == "success") { | 97 | if (res.data == "success") { |
| 98 | that.$message({ | 98 | that.$message({ |
| 99 | showClose: true, | 99 | showClose: true, |
| @@ -105,10 +105,9 @@ export default { | @@ -105,10 +105,9 @@ export default { | ||
| 105 | that.listChangeCallback(); | 105 | that.listChangeCallback(); |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | - }) | ||
| 109 | - .catch(function (error) { | 108 | + }).catch(function (error) { |
| 110 | console.log(error); | 109 | console.log(error); |
| 111 | - }); | 110 | + }); |
| 112 | }, | 111 | }, |
| 113 | close: function () { | 112 | close: function () { |
| 114 | console.log("关闭加入GB"); | 113 | console.log("关闭加入GB"); |
| @@ -118,14 +117,14 @@ export default { | @@ -118,14 +117,14 @@ export default { | ||
| 118 | deviceGBIdExit: async function (deviceGbId) { | 117 | deviceGBIdExit: async function (deviceGbId) { |
| 119 | var result = false; | 118 | var result = false; |
| 120 | var that = this; | 119 | var that = this; |
| 121 | - await that.$axios | ||
| 122 | - .post(`/api/platform/exit/${deviceGbId}`) | ||
| 123 | - .then(function (res) { | ||
| 124 | - result = res.data; | ||
| 125 | - }) | ||
| 126 | - .catch(function (error) { | ||
| 127 | - console.log(error); | ||
| 128 | - }); | 120 | + await that.$axios({ |
| 121 | + method:"post", | ||
| 122 | + url:`/api/platform/exit/${deviceGbId}` | ||
| 123 | + }).then(function (res) { | ||
| 124 | + result = res.data; | ||
| 125 | + }).catch(function (error) { | ||
| 126 | + console.log(error); | ||
| 127 | + }); | ||
| 129 | return result; | 128 | return result; |
| 130 | }, | 129 | }, |
| 131 | checkExpires: function() { | 130 | checkExpires: function() { |
web_src/src/components/dialog/chooseChannelForGb.vue
| @@ -182,7 +182,9 @@ export default { | @@ -182,7 +182,9 @@ export default { | ||
| 182 | getChannelList: function () { | 182 | getChannelList: function () { |
| 183 | let that = this; | 183 | let that = this; |
| 184 | 184 | ||
| 185 | - this.$axios.get(`/api/platform/channel_list`, { | 185 | + this.$axios({ |
| 186 | + method:"get", | ||
| 187 | + url:`/api/platform/channel_list`, | ||
| 186 | params: { | 188 | params: { |
| 187 | page: that.currentPage, | 189 | page: that.currentPage, |
| 188 | count: that.count, | 190 | count: that.count, |
web_src/src/components/dialog/chooseChannelForStream.vue
| @@ -162,16 +162,18 @@ export default { | @@ -162,16 +162,18 @@ export default { | ||
| 162 | getChannelList: function () { | 162 | getChannelList: function () { |
| 163 | let that = this; | 163 | let that = this; |
| 164 | 164 | ||
| 165 | - this.$axios.get(`/api/gbStream/list`, { | ||
| 166 | - params: { | ||
| 167 | - page: that.currentPage, | ||
| 168 | - count: that.count, | ||
| 169 | - query: that.searchSrt, | ||
| 170 | - online: that.online, | ||
| 171 | - choosed: that.choosed, | ||
| 172 | - platformId: that.platformId, | ||
| 173 | - channelType: that.channelType | ||
| 174 | - } | 165 | + this.$axios({ |
| 166 | + method: 'get', | ||
| 167 | + url:`/api/gbStream/list`, | ||
| 168 | + params: { | ||
| 169 | + page: that.currentPage, | ||
| 170 | + count: that.count, | ||
| 171 | + query: that.searchSrt, | ||
| 172 | + online: that.online, | ||
| 173 | + choosed: that.choosed, | ||
| 174 | + platformId: that.platformId, | ||
| 175 | + channelType: that.channelType | ||
| 176 | + } | ||
| 175 | }) | 177 | }) |
| 176 | .then(function (res) { | 178 | .then(function (res) { |
| 177 | that.total = res.data.total; | 179 | that.total = res.data.total; |
web_src/src/components/dialog/platformEdit.vue
| @@ -163,17 +163,17 @@ export default { | @@ -163,17 +163,17 @@ export default { | ||
| 163 | methods: { | 163 | methods: { |
| 164 | openDialog: function (platform, callback) { | 164 | openDialog: function (platform, callback) { |
| 165 | var that = this; | 165 | var that = this; |
| 166 | - this.$axios | ||
| 167 | - .get(`/api/platform/server_config`) | ||
| 168 | - .then(function (res) { | 166 | + this.$axios({ |
| 167 | + method: 'get', | ||
| 168 | + url:`/api/platform/server_config` | ||
| 169 | + }).then(function (res) { | ||
| 169 | console.log(res); | 170 | console.log(res); |
| 170 | that.platform.deviceGBId = res.data.username; | 171 | that.platform.deviceGBId = res.data.username; |
| 171 | that.platform.deviceIp = res.data.deviceIp; | 172 | that.platform.deviceIp = res.data.deviceIp; |
| 172 | that.platform.devicePort = res.data.devicePort; | 173 | that.platform.devicePort = res.data.devicePort; |
| 173 | that.platform.username = res.data.username; | 174 | that.platform.username = res.data.username; |
| 174 | that.platform.password = res.data.password; | 175 | that.platform.password = res.data.password; |
| 175 | - }) | ||
| 176 | - .catch(function (error) { | 176 | + }).catch(function (error) { |
| 177 | console.log(error); | 177 | console.log(error); |
| 178 | }); | 178 | }); |
| 179 | this.showDialog = true; | 179 | this.showDialog = true; |
| @@ -188,11 +188,11 @@ export default { | @@ -188,11 +188,11 @@ export default { | ||
| 188 | onSubmit: function () { | 188 | onSubmit: function () { |
| 189 | console.log("onSubmit"); | 189 | console.log("onSubmit"); |
| 190 | var that = this; | 190 | var that = this; |
| 191 | - that.$axios | ||
| 192 | - .post(`/api/platform/save`, that.platform) | ||
| 193 | - .then(function (res) { | ||
| 194 | - console.log(res); | ||
| 195 | - console.log(res.data == "success"); | 191 | + that.$axios({ |
| 192 | + method: 'post', | ||
| 193 | + url:`/api/platform/save`, | ||
| 194 | + data: that.platform | ||
| 195 | + }).then(function (res) { | ||
| 196 | if (res.data == "success") { | 196 | if (res.data == "success") { |
| 197 | that.$message({ | 197 | that.$message({ |
| 198 | showClose: true, | 198 | showClose: true, |
| @@ -204,8 +204,7 @@ export default { | @@ -204,8 +204,7 @@ export default { | ||
| 204 | that.listChangeCallback(); | 204 | that.listChangeCallback(); |
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | - }) | ||
| 208 | - .catch(function (error) { | 207 | + }).catch(function (error) { |
| 209 | console.log(error); | 208 | console.log(error); |
| 210 | }); | 209 | }); |
| 211 | }, | 210 | }, |
| @@ -218,8 +217,9 @@ export default { | @@ -218,8 +217,9 @@ export default { | ||
| 218 | deviceGBIdExit: async function (deviceGbId) { | 217 | deviceGBIdExit: async function (deviceGbId) { |
| 219 | var result = false; | 218 | var result = false; |
| 220 | var that = this; | 219 | var that = this; |
| 221 | - await that.$axios | ||
| 222 | - .post(`/api/platform/exit/${deviceGbId}`) | 220 | + await that.$axios({ |
| 221 | + method: 'post', | ||
| 222 | + url:`/api/platform/exit/${deviceGbId}`}) | ||
| 223 | .then(function (res) { | 223 | .then(function (res) { |
| 224 | result = res.data; | 224 | result = res.data; |
| 225 | }) | 225 | }) |
web_src/src/components/dialog/rtcPlayer.vue
| @@ -11,7 +11,8 @@ export default { | @@ -11,7 +11,8 @@ export default { | ||
| 11 | name: 'rtcPlayer', | 11 | name: 'rtcPlayer', |
| 12 | data() { | 12 | data() { |
| 13 | return { | 13 | return { |
| 14 | - webrtcPlayer: null | 14 | + webrtcPlayer: null, |
| 15 | + timer: null | ||
| 15 | }; | 16 | }; |
| 16 | }, | 17 | }, |
| 17 | props: ['videoUrl', 'error', 'hasaudio'], | 18 | props: ['videoUrl', 'error', 'hasaudio'], |
| @@ -55,7 +56,7 @@ export default { | @@ -55,7 +56,7 @@ export default { | ||
| 55 | this.eventcallbacK("OFFER ANSWER ERROR ", "offer anwser 交换失败") | 56 | this.eventcallbacK("OFFER ANSWER ERROR ", "offer anwser 交换失败") |
| 56 | if (e.code ==-400 && e.msg=="流不存在"){ | 57 | if (e.code ==-400 && e.msg=="流不存在"){ |
| 57 | console.log("111111") | 58 | console.log("111111") |
| 58 | - setTimeout(()=>{ | 59 | + this.timer = setTimeout(()=>{ |
| 59 | this.webrtcPlayer.close(); | 60 | this.webrtcPlayer.close(); |
| 60 | this.play(url) | 61 | this.play(url) |
| 61 | }, 100) | 62 | }, 100) |
| @@ -83,6 +84,9 @@ export default { | @@ -83,6 +84,9 @@ export default { | ||
| 83 | console.log(message) | 84 | console.log(message) |
| 84 | } | 85 | } |
| 85 | }, | 86 | }, |
| 87 | + destroyed() { | ||
| 88 | + clearTimeout(this.timer); | ||
| 89 | + }, | ||
| 86 | } | 90 | } |
| 87 | </script> | 91 | </script> |
| 88 | 92 |