优化登录体验。修复因为流地址导致的录像服务无法识别
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", "-1"); |
| | | jsonObject.put("msg", "请登录后重新请求"); |
| | | if (request.getRequestURI().contains("api/user/login")){ |
| | | jsonObject.put("msg", e.getMessage()); |
| | | } |
| | | response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); |
| | | try { |
| | | response.getWriter().print(jsonObject.toJSONString()); |
| | |
| | | String app = json.getString("app");
|
| | | String streamId = json.getString("stream");
|
| | | if ("rtp".equals(app)) {
|
| | | String[] s = streamId.split("/");
|
| | | String[] s = streamId.split("_");
|
| | | if (s.length == 2) {
|
| | | String deviceId = s[0];
|
| | | String channelId = s[1];
|
| | |
| | | SSRCInfo ssrcInfo;
|
| | | String streamId2 = null;
|
| | | if (mediaInfo.isRtpEnable()) {
|
| | | streamId2 = String.format("%s/%s", device.getDeviceId(), channelId);
|
| | | streamId2 = String.format("%s_%s", device.getDeviceId(), channelId);
|
| | | }
|
| | | ssrcInfo = mediaServerService.openRTPServer(mediaInfo, streamId2);
|
| | | cmder.playStreamCmd(mediaInfo, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> {
|
| | |
| | | String mediaServerId = streamSession.getMediaServerId(device.getDeviceId(), channelId); |
| | | MediaServerItem mediaServerItem = this.getOne(mediaServerId); |
| | | if (mediaServerItem != null) { |
| | | String streamId = String.format("%s/%s", device.getDeviceId(), channelId); |
| | | String streamId = String.format("%s_%s", device.getDeviceId(), channelId); |
| | | zlmrtpServerFactory.closeRTPServer(mediaServerItem, streamId); |
| | | releaseSsrc(mediaServerItem, streamSession.getSSRC(device.getDeviceId(), channelId)); |
| | | } |
| | |
| | | SSRCInfo ssrcInfo; |
| | | String streamId = null; |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | streamId = String.format("%s/%s", device.getDeviceId(), channelId); |
| | | streamId = String.format("%s_%s", device.getDeviceId(), channelId); |
| | | } |
| | | |
| | | ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId); |
| | |
| | | SSRCInfo ssrcInfo; |
| | | String streamId2 = null; |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | streamId2 = String.format("%s/%s", device.getDeviceId(), channelId); |
| | | streamId2 = String.format("%s_%s", device.getDeviceId(), channelId); |
| | | } |
| | | ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId2); |
| | | |
| | |
| | | @GetMapping("/stop/{deviceId}/{channelId}") |
| | | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String deviceId, @PathVariable String channelId) { |
| | | |
| | | logger.debug(String.format("设备预览/回放停止API调用,streamId:%s/%s", deviceId, channelId )); |
| | | logger.debug(String.format("设备预览/回放停止API调用,streamId:%s_%s", deviceId, channelId )); |
| | | |
| | | UUID uuid = UUID.randomUUID(); |
| | | DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(); |
| | |
| | | |
| | | // 超时处理 |
| | | result.onTimeout(()->{ |
| | | logger.warn(String.format("设备预览/回放停止超时,deviceId/channelId:%s/%s ", deviceId, channelId)); |
| | | logger.warn(String.format("设备预览/回放停止超时,deviceId/channelId:%s_%s ", deviceId, channelId)); |
| | | RequestMessage msg = new RequestMessage(); |
| | | msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid); |
| | | msg.setData("Timeout"); |
| | |
| | | cmder.streamByeCmd(deviceId, channelId); |
| | | |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug(String.format("设备历史媒体下载停止 API调用,deviceId/channelId:%s/%s", deviceId, channelId)); |
| | | logger.debug(String.format("设备历史媒体下载停止 API调用,deviceId/channelId:%s_%s", deviceId, channelId)); |
| | | } |
| | | |
| | | if (deviceId != null && channelId != null) { |
| | |
| | | </div> |
| | | |
| | | <div class="container-login100-form-btn"> |
| | | <div class="wrap-login100-form-btn"> |
| | | <div class="wrap-login100-form-btn" :class="{'login-loading': isLoging}" v-loading="isLoging" element-loading-background="rgb(0 0 0 / 0%);" element-loading-custom-class="login-loading-class"> |
| | | <div class="login100-form-bgbtn"></div> |
| | | <button class="login100-form-btn" @click="login">登录</button> |
| | | </div> |
| | |
| | | return { |
| | | isLoging: false, |
| | | showPassword: false, |
| | | loginLoading: false, |
| | | username: '', |
| | | password: '' |
| | | } |
| | |
| | | .p-b-48 {padding-bottom: 48px;} |
| | | .p-t-115 {padding-top: 115px;} |
| | | |
| | | @keyframes login { |
| | | from {width: 100%} |
| | | to {width: 50px} |
| | | } |
| | | |
| | | .login-loading{ |
| | | width: 50px; |
| | | animation-name: login; |
| | | animation-duration: 0.5s; |
| | | } |
| | | .login-loading > .login100-form-btn { |
| | | visibility: hidden !important; |
| | | } |
| | | .login-loading-class{ |
| | | stroke: rgb(255, 255, 255) !important; |
| | | background-color: transparent !important; |
| | | } |
| | | |
| | | .login-loading-class > .el-loading-spinner .path { |
| | | stroke: rgb(255, 255, 255) !important; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /**font**/ |
| | | /* .zmdi { |
| | | display: inline-block; |