From 0a951e876abf952e7f65a68c5147a5a18e261d64 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 11 Oct 2021 18:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/service/impl/MediaServiceImpl.java | 2 +- .../com/genersoft/iot/vmp/vmanager/user/UserController.java | 6 +++++- web_src/src/components/dialog/changePassword.vue | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java index 33ad2ba5..51c5979e 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java @@ -95,7 +95,7 @@ public class MediaServiceImpl implements IMediaService { streamInfoResult.setHttps_ts(String.format("https://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream)); streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream)); streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream)); - streamInfoResult.setRtc(String.format("http://%s:%s/index/api/webrtc?app=%s&stream=%s&type=play", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream)); + streamInfoResult.setRtc(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=play", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream)); } streamInfoResult.setTracks(tracks); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java index 756fecd9..17fe2fb6 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java @@ -76,7 +76,11 @@ public class UserController { @PostMapping("/changePassword") public String changePassword(@RequestParam String oldPassword, @RequestParam String password){ // 获取当前登录用户id - String username = SecurityUtils.getUserInfo().getUsername(); + LoginUser userInfo = SecurityUtils.getUserInfo(); + if (userInfo== null) { + return "fail"; + } + String username = userInfo.getUsername(); LoginUser user = null; try { user = SecurityUtils.login(username, oldPassword, authenticationManager); diff --git a/web_src/src/components/dialog/changePassword.vue b/web_src/src/components/dialog/changePassword.vue index eade6a8b..a95736f2 100644 --- a/web_src/src/components/dialog/changePassword.vue +++ b/web_src/src/components/dialog/changePassword.vue @@ -106,6 +106,12 @@ export default { this.$router.push('/login'); this.sseSource.close(); },800) + }else { + this.$message({ + showClose: true, + message: '修改密码失败,是否已登录(接口鉴权关闭无法修改密码)', + type: 'error' + }); } }).catch((error)=> { console.error(error)