Commit 3578c1c0403a0455fca0fd46101b2cedd42a5a5a

Authored by 648540858
1 parent 792c9369

优化登录体验。修复因为流地址导致的录像服务无法识别

src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java
... ... @@ -30,6 +30,9 @@ public class AnonymousAuthenticationEntryPoint implements AuthenticationEntryPoi
30 30 JSONObject jsonObject = new JSONObject();
31 31 jsonObject.put("code", "-1");
32 32 jsonObject.put("msg", "请登录后重新请求");
  33 + if (request.getRequestURI().contains("api/user/login")){
  34 + jsonObject.put("msg", e.getMessage());
  35 + }
33 36 response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
34 37 try {
35 38 response.getWriter().print(jsonObject.toJSONString());
... ...
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
... ... @@ -376,7 +376,7 @@ public class ZLMHttpHookListener {
376 376 String app = json.getString("app");
377 377 String streamId = json.getString("stream");
378 378 if ("rtp".equals(app)) {
379   - String[] s = streamId.split("/");
  379 + String[] s = streamId.split("_");
380 380 if (s.length == 2) {
381 381 String deviceId = s[0];
382 382 String channelId = s[1];
... ... @@ -386,7 +386,7 @@ public class ZLMHttpHookListener {
386 386 SSRCInfo ssrcInfo;
387 387 String streamId2 = null;
388 388 if (mediaInfo.isRtpEnable()) {
389   - streamId2 = String.format("%s/%s", device.getDeviceId(), channelId);
  389 + streamId2 = String.format("%s_%s", device.getDeviceId(), channelId);
390 390 }
391 391 ssrcInfo = mediaServerService.openRTPServer(mediaInfo, streamId2);
392 392 cmder.playStreamCmd(mediaInfo, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> {
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
... ... @@ -122,7 +122,7 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR
122 122 String mediaServerId = streamSession.getMediaServerId(device.getDeviceId(), channelId);
123 123 MediaServerItem mediaServerItem = this.getOne(mediaServerId);
124 124 if (mediaServerItem != null) {
125   - String streamId = String.format("%s/%s", device.getDeviceId(), channelId);
  125 + String streamId = String.format("%s_%s", device.getDeviceId(), channelId);
126 126 zlmrtpServerFactory.closeRTPServer(mediaServerItem, streamId);
127 127 releaseSsrc(mediaServerItem, streamSession.getSSRC(device.getDeviceId(), channelId));
128 128 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
... ... @@ -155,7 +155,7 @@ public class PlayServiceImpl implements IPlayService {
155 155 SSRCInfo ssrcInfo;
156 156 String streamId = null;
157 157 if (mediaServerItem.isRtpEnable()) {
158   - streamId = String.format("%s/%s", device.getDeviceId(), channelId);
  158 + streamId = String.format("%s_%s", device.getDeviceId(), channelId);
159 159 }
160 160  
161 161 ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId);
... ... @@ -220,7 +220,7 @@ public class PlayServiceImpl implements IPlayService {
220 220 SSRCInfo ssrcInfo;
221 221 String streamId2 = null;
222 222 if (mediaServerItem.isRtpEnable()) {
223   - streamId2 = String.format("%s/%s", device.getDeviceId(), channelId);
  223 + streamId2 = String.format("%s_%s", device.getDeviceId(), channelId);
224 224 }
225 225 ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId2);
226 226  
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
... ... @@ -101,7 +101,7 @@ public class PlayController {
101 101 @GetMapping("/stop/{deviceId}/{channelId}")
102 102 public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String deviceId, @PathVariable String channelId) {
103 103  
104   - logger.debug(String.format("设备预览/回放停止API调用,streamId:%s/%s", deviceId, channelId ));
  104 + logger.debug(String.format("设备预览/回放停止API调用,streamId:%s_%s", deviceId, channelId ));
105 105  
106 106 UUID uuid = UUID.randomUUID();
107 107 DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>();
... ... @@ -147,7 +147,7 @@ public class PlayController {
147 147  
148 148 // 超时处理
149 149 result.onTimeout(()->{
150   - logger.warn(String.format("设备预览/回放停止超时,deviceId/channelId:%s/%s ", deviceId, channelId));
  150 + logger.warn(String.format("设备预览/回放停止超时,deviceId/channelId:%s_%s ", deviceId, channelId));
151 151 RequestMessage msg = new RequestMessage();
152 152 msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid);
153 153 msg.setData("Timeout");
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/DownloadController.java
... ... @@ -130,7 +130,7 @@ public class DownloadController {
130 130 cmder.streamByeCmd(deviceId, channelId);
131 131  
132 132 if (logger.isDebugEnabled()) {
133   - logger.debug(String.format("设备历史媒体下载停止 API调用,deviceId/channelId:%s/%s", deviceId, channelId));
  133 + logger.debug(String.format("设备历史媒体下载停止 API调用,deviceId/channelId:%s_%s", deviceId, channelId));
134 134 }
135 135  
136 136 if (deviceId != null && channelId != null) {
... ...
web_src/src/assets/logo.png

6.69 KB | W: | H:

65.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
web_src/src/components/Login.vue
... ... @@ -22,7 +22,7 @@
22 22 </div>
23 23  
24 24 <div class="container-login100-form-btn">
25   - <div class="wrap-login100-form-btn">
  25 + <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">
26 26 <div class="login100-form-bgbtn"></div>
27 27 <button class="login100-form-btn" @click="login">登录</button>
28 28 </div>
... ... @@ -41,6 +41,7 @@ export default {
41 41 return {
42 42 isLoging: false,
43 43 showPassword: false,
  44 + loginLoading: false,
44 45 username: '',
45 46 password: ''
46 47 }
... ...
web_src/static/css/login.css
... ... @@ -376,6 +376,31 @@
376 376 .p-b-48 {padding-bottom: 48px;}
377 377 .p-t-115 {padding-top: 115px;}
378 378  
  379 +@keyframes login {
  380 + from {width: 100%}
  381 + to {width: 50px}
  382 +}
  383 +
  384 +.login-loading{
  385 + width: 50px;
  386 + animation-name: login;
  387 + animation-duration: 0.5s;
  388 +}
  389 +.login-loading > .login100-form-btn {
  390 + visibility: hidden !important;
  391 +}
  392 +.login-loading-class{
  393 + stroke: rgb(255, 255, 255) !important;
  394 + background-color: transparent !important;
  395 +}
  396 +
  397 +.login-loading-class > .el-loading-spinner .path {
  398 + stroke: rgb(255, 255, 255) !important;
  399 +}
  400 +
  401 +
  402 +
  403 +
379 404 /**font**/
380 405 /* .zmdi {
381 406 display: inline-block;
... ...