From a7c3cf531640bb59aa90cb476b8c21db97f41ddb Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期日, 05 三月 2023 09:53:26 +0800 Subject: [PATCH] 优化跨域配置,支持同域的前后端分离部署 --- src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java | 5 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java | 2 web_src/src/components/service/MediaServer.js | 14 +- src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java | 2 src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java | 9 - web_src/src/components/dialog/chooseChannelForCatalog.vue | 8 web_src/src/components/dialog/pushStreamEdit.vue | 6 web_src/src/components/dialog/getCatalog.vue | 4 web_src/index.html | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java | 2 web_src/src/components/Login.vue | 2 web_src/src/main.js | 8 web_src/src/components/dialog/SyncChannelProgress.vue | 2 web_src/src/components/GBRecordDetail.vue | 16 +- web_src/src/components/dialog/StreamProxyEdit.vue | 8 src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java | 2 web_src/src/components/DeviceList.vue | 10 web_src/src/components/dialog/platformEdit.vue | 6 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java | 2 web_src/src/components/StreamProxyList.vue | 12 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java | 8 - src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java | 2 web_src/src/components/live.vue | 2 web_src/src/components/dialog/onvifEdit.vue | 2 src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java | 2 web_src/src/components/map.vue | 2 web_src/src/components/dialog/chooseChannelForStream.vue | 10 web_src/src/components/dialog/chooseChannel.vue | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java | 16 +- web_src/src/components/dialog/queryTrace.vue | 2 src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java | 2 web_src/src/components/dialog/changePasswordForAdmin.vue | 2 web_src/src/components/console.vue | 8 web_src/src/components/service/DeviceService.js | 10 src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java | 6 web_src/src/components/dialog/catalogEdit.vue | 2 web_src/src/components/PushVideoList.vue | 10 src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java | 2 web_src/src/components/CloudRecord.vue | 4 web_src/src/components/dialog/MediaServerEdit.vue | 2 web_src/src/components/dialog/chooseChannelForGb.vue | 10 src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java | 3 web_src/src/components/dialog/deviceEdit.vue | 2 web_src/src/components/dialog/devicePlayer.vue | 14 +- web_src/src/components/dialog/addUser.vue | 4 web_src/src/components/CloudRecordDetail.vue | 10 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java | 2 doc/_content/ability/gis.md | 2 web_src/config/index.js | 10 web_src/src/components/UserManager.vue | 4 web_src/src/components/dialog/changePassword.vue | 2 src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java | 11 + web_src/src/components/ParentPlatformList.vue | 4 src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java | 6 src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java | 12 - src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java | 2 web_src/src/components/channelList.vue | 12 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java | 2 web_src/src/components/dialog/channelMapInfobox.vue | 2 web_src/static/js/config.js | 3 web_src/src/components/dialog/recordDownload.vue | 8 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java | 2 src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java | 2 web_src/build/utils.js | 3 web_src/src/components/dialog/importChannel.vue | 2 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java | 2 web_src/src/components/dialog/changePushKey.vue | 2 71 files changed, 173 insertions(+), 191 deletions(-) diff --git a/doc/_content/ability/gis.md b/doc/_content/ability/gis.md index 8796dba..f77a428 100644 --- a/doc/_content/ability/gis.md +++ b/doc/_content/ability/gis.md @@ -14,7 +14,7 @@ PS锛� 鐩墠鐨勫簳鍥句粎鐢ㄧ敤浣滄紨绀哄拰瀛︿範锛屽晢鐢ㄦ儏鍐佃鑷璐拱鎺堟潈浣跨敤銆� ### 鏇存崲搴曞浘浠ュ強搴曞浘閰嶇疆 -鐩墠WVP鏀寔浣跨敤浜嗘洿鎹㈠簳鍥撅紝閰嶇疆鏂囦欢鍦╳eb_src/static/js/mapConfig.js锛岃淇敼鍚庨噸鏂扮紪璇戝墠绔枃浠躲�� +鐩墠WVP鏀寔浣跨敤浜嗘洿鎹㈠簳鍥撅紝閰嶇疆鏂囦欢鍦╳eb_src/static/js/config.js锛岃淇敼鍚庨噸鏂扮紪璇戝墠绔枃浠躲�� ```javascript window.mapParam = { // 寮�鍚�/鍏抽棴鍦板浘鍔熻兘 diff --git a/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java b/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java index 7133e14..e30b6db 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java @@ -48,6 +48,13 @@ long start = System.currentTimeMillis(); // 璇锋眰杩涘叆鏃堕棿 String uriName = ApiSaveConstant.getVal(servletRequest.getRequestURI()); + String origin = servletRequest.getHeader("Origin"); + servletResponse.setContentType("application/json;charset=UTF-8"); + servletResponse.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*"); + servletResponse.setHeader("Access-Control-Allow-Credentials", "true"); + servletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT"); + servletResponse.setHeader("Access-Control-Max-Age", "3600"); + servletResponse.setHeader("Access-Control-Allow-Headers", "token,Content-Type,Content-Length, Authorization, Accept,X-Requested-With,domain,zdy"); filterChain.doFilter(servletRequest, servletResponse); if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) { @@ -65,9 +72,7 @@ logDto.setUri(servletRequest.getRequestURI()); logDto.setCreateTime(DateUtil.getNow()); logService.add(logDto); -// logger.warn("[Api Access] [{}] [{}] [{}] [{}] [{}] {}ms", -// uriName, servletRequest.getMethod(), servletRequest.getRequestURI(), servletRequest.getRemoteAddr(), HttpStatus.valueOf(servletResponse.getStatus()), -// System.currentTimeMillis() - start); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java b/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java index cd50420..35c68d5 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java @@ -2,7 +2,6 @@ import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import org.apache.poi.hssf.eventmodel.ERFListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.AuthenticationException; @@ -25,7 +24,10 @@ @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) { // 鍏佽璺ㄥ煙 - response.setHeader("Access-Control-Allow-Origin", "*"); + String origin = request.getHeader("Origin"); + response.setHeader("Access-Control-Allow-Credentials", "true"); + response.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*"); + response.setHeader("Access-Control-Allow-Methods", "PUT,POST, GET,DELETE,OPTIONS"); // 鍏佽鑷畾涔夎姹傚ごtoken(鍏佽head璺ㄥ煙) response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified"); response.setHeader("Content-type", "application/json;charset=UTF-8"); diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index a795e77..a07a47c 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -112,6 +112,7 @@ * 鏈嶅姟鍣ㄥ畾鏃朵笂鎶ユ椂闂达紝涓婃姤闂撮殧鍙厤缃紝榛樿10s涓婃姤涓�娆� */ @ResponseBody + @PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8") public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveHookParam param) { @@ -135,6 +136,7 @@ * 鎾斁鍣ㄩ壌鏉冧簨浠讹紝rtsp/rtmp/http-flv/ws-flv/hls鐨勬挱鏀鹃兘灏嗚Е鍙戞閴存潈浜嬩欢銆� */ @ResponseBody + @PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8") public HookResult onPlay(@RequestBody OnPlayHookParam param) { if (logger.isDebugEnabled()) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java index 305d488..5046faa 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java @@ -30,7 +30,7 @@ * 浣嶇疆淇℃伅绠$悊 */ @Tag(name = "浣嶇疆淇℃伅绠$悊") -@CrossOrigin + @RestController @RequestMapping("/api/position") public class MobilePositionController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java index d58d431..b1ad3b9 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java @@ -17,7 +17,7 @@ * @data: 2021-01-20 */ @Tag(name = "SSE鎺ㄩ��") -@CrossOrigin + @Controller @RequestMapping("/api") public class SseController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java index e030b17..0015530 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java @@ -6,24 +6,18 @@ import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; -import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener; import com.genersoft.iot.vmp.service.IDeviceAlarmService; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.sip.InvalidArgumentException; @@ -34,7 +28,7 @@ import java.util.List; @Tag(name = "鎶ヨ淇℃伅绠$悊") -@CrossOrigin + @RestController @RequestMapping("/api/alarm") public class AlarmController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java index 651d9ac..eac68ca 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java @@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; - import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -22,9 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; @@ -34,7 +31,7 @@ import java.util.UUID; @Tag(name = "鍥芥爣璁惧閰嶇疆") -@CrossOrigin + @RestController @RequestMapping("/api/device/config") public class DeviceConfig { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java index ff0d8b4..bf0acb5 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java @@ -32,7 +32,7 @@ import java.util.UUID; @Tag(name = "鍥芥爣璁惧鎺у埗") -@CrossOrigin + @RestController @RequestMapping("/api/device/control") public class DeviceControl { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java index c15d771..7a8732c 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java @@ -46,7 +46,7 @@ @Tag(name = "鍥芥爣璁惧鏌ヨ", description = "鍥芥爣璁惧鏌ヨ") @SuppressWarnings("rawtypes") -@CrossOrigin + @RestController @RequestMapping("/api/device/query") public class DeviceQuery { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java index 447944a..5e67372 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java @@ -17,7 +17,7 @@ import java.util.List; @Tag(name = "瑙嗛娴佸叧鑱斿埌绾ц仈骞冲彴") -@CrossOrigin + @RestController @RequestMapping("/api/gbStream") public class GbStreamController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java index d135fa2..8e0e201 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java @@ -24,7 +24,7 @@ @Tag(name = "濯掍綋娴佺浉鍏�") @Controller -@CrossOrigin + @RequestMapping(value = "/api/media") public class MediaController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java index 40b65c3..7628f7c 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java @@ -37,7 +37,7 @@ * 绾ц仈骞冲彴绠$悊 */ @Tag(name = "绾ц仈骞冲彴绠$悊") -@CrossOrigin + @RestController @RequestMapping("/api/platform") public class PlatformController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java index c94dbf2..958cc68 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java @@ -40,7 +40,7 @@ import java.util.UUID; @Tag(name = "鍥芥爣璁惧鐐规挱") -@CrossOrigin + @RestController @RequestMapping("/api/play") public class PlayController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java index eb6f997..8bab3fd 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java @@ -40,7 +40,7 @@ * @author lin */ @Tag(name = "瑙嗛鍥炴斁") -@CrossOrigin + @RestController @RequestMapping("/api/playback") public class PlaybackController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java index 171f57c..e9ea457 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java @@ -1,7 +1,12 @@ package com.genersoft.iot.vmp.vmanager.gb28181.ptz; - + import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.gb28181.bean.Device; +import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; +import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; +import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -10,15 +15,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; - -import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; -import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; -import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import javax.sip.InvalidArgumentException; import javax.sip.SipException; @@ -26,7 +24,7 @@ import java.util.UUID; @Tag(name = "浜戝彴鎺у埗") -@CrossOrigin + @RestController @RequestMapping("/api/ptz") public class PtzController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java index c3b9c78..093b324 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java @@ -36,7 +36,7 @@ import java.util.UUID; @Tag(name = "鍥芥爣褰曞儚") -@CrossOrigin + @RestController @RequestMapping("/api/gb_record") public class GBRecordController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java index 42efbb1..3cabb99 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java @@ -6,25 +6,18 @@ import com.genersoft.iot.vmp.storager.dao.dto.LogDto; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; -import java.text.ParseException; - @Tag(name = "鏃ュ織绠$悊") -@CrossOrigin + @RestController @RequestMapping("/api/log") public class LogController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java index ec88b50..6e2aca3 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java @@ -14,7 +14,7 @@ //import org.springframework.web.bind.annotation.*; // //@Tag(name = "浜戠褰曞儚") -//@CrossOrigin +// //@RestController //@RequestMapping("/api/record") //public class RecordController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java index 6b8550d..ad2c13b 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java @@ -2,7 +2,6 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; -import com.genersoft.iot.vmp.VManageBootstrap; import com.genersoft.iot.vmp.common.SystemAllInfo; import com.genersoft.iot.vmp.common.VersionPo; import com.genersoft.iot.vmp.conf.SipConfig; @@ -15,13 +14,10 @@ import com.genersoft.iot.vmp.service.*; import com.genersoft.iot.vmp.service.bean.MediaServerLoad; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; -import com.genersoft.iot.vmp.utils.SpringBeanFactory; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; -import gov.nist.javax.sip.SipStackImpl; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -31,14 +27,12 @@ import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; -import javax.sip.ListeningPoint; -import javax.sip.ObjectInUseException; -import javax.sip.SipProvider; -import java.util.*; +import java.util.ArrayList; +import java.util.List; @SuppressWarnings("rawtypes") @Tag(name = "鏈嶅姟鎺у埗") -@CrossOrigin + @RestController @RequestMapping("/api/server") public class ServerController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java index 65ec3d3..4a8522b 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java @@ -25,7 +25,7 @@ */ @Tag(name = "鎷夋祦浠g悊", description = "") @Controller -@CrossOrigin + @RequestMapping(value = "/api/proxy") public class StreamProxyController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index 7506433..6622568 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -41,7 +41,7 @@ @Tag(name = "鎺ㄦ祦淇℃伅绠$悊") @Controller -@CrossOrigin + @RequestMapping(value = "/api/push") public class StreamPushController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java index 769dca0..f34f1c4 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java @@ -6,20 +6,16 @@ import com.genersoft.iot.vmp.storager.dao.dto.Role; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; @Tag(name = "瑙掕壊绠$悊") -@CrossOrigin + @RestController @RequestMapping("/api/role") public class RoleController { 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 157cb75..127e83b 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 @@ -24,7 +24,7 @@ import java.util.List; @Tag(name = "鐢ㄦ埛绠$悊") -@CrossOrigin + @RestController @RequestMapping("/api/user") public class UserController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java index be2bbc1..6f2fe54 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java @@ -18,7 +18,7 @@ /** * API鍏煎锛氳澶囨帶鍒� */ -@CrossOrigin + @RestController @RequestMapping(value = "/api/v1/control") public class ApiControlController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java index e6286d6..bd5d5ef 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java @@ -6,7 +6,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -14,7 +13,7 @@ * API鍏煎锛氱郴缁熸帴鍙� */ @Controller -@CrossOrigin + @RequestMapping(value = "/api/v1") public class ApiController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java index e5f4227..5065523 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java @@ -20,7 +20,7 @@ * API鍏煎锛氳澶囦俊鎭� */ @SuppressWarnings("unchecked") -@CrossOrigin + @RestController @RequestMapping(value = "/api/v1/device") public class ApiDeviceController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java index 5381a3a..72a1b5d 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java @@ -26,7 +26,7 @@ * API鍏煎锛氬疄鏃剁洿鎾� */ @SuppressWarnings(value = {"rawtypes", "unchecked"}) -@CrossOrigin + @RestController @RequestMapping(value = "/api/v1/stream") public class ApiStreamController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java index abefa42..d503f15 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java @@ -5,7 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -@CrossOrigin + @RestController @RequestMapping(value = "/auth") public class AuthController { diff --git a/web_src/build/utils.js b/web_src/build/utils.js index bc98c13..e534fb0 100644 --- a/web_src/build/utils.js +++ b/web_src/build/utils.js @@ -47,8 +47,7 @@ if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, - fallback: 'vue-style-loader', - publicPath: '../../' + fallback: 'vue-style-loader' }) } else { return ['vue-style-loader'].concat(loaders) diff --git a/web_src/config/index.js b/web_src/config/index.js index 6f0ca8b..b1e1cbe 100644 --- a/web_src/config/index.js +++ b/web_src/config/index.js @@ -8,18 +8,18 @@ dev: { // Paths - assetsSubDirectory: './static', - assetsPublicPath: './', + assetsSubDirectory: 'static', + assetsPublicPath: '/', proxyTable: { '/debug': { - target: 'http://localhost:38080', + target: 'http://localhost:18080', changeOrigin: true, pathRewrite: { '^/debug': '/' } }, '/static/snap': { - target: 'http://localhost:38080', + target: 'http://localhost:18080', changeOrigin: true, // pathRewrite: { // '^/static/snap': '/static/snap' @@ -61,7 +61,7 @@ // Paths assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'), assetsSubDirectory: './static', - assetsPublicPath: './', + assetsPublicPath: '/', /** * Source Maps diff --git a/web_src/index.html b/web_src/index.html index e338faa..778591e 100644 --- a/web_src/index.html +++ b/web_src/index.html @@ -13,7 +13,7 @@ <script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script> <script type="text/javascript" src="./static/js/liveplayer-lib.min.js"></script> <script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script> - <script type="text/javascript" src="./static/js/mapConfig.js"></script> + <script type="text/javascript" src="./static/js/config.js"></script> <div id="app"></div> </body> </html> diff --git a/web_src/src/components/CloudRecord.vue b/web_src/src/components/CloudRecord.vue index bd374fc..b046fc9 100644 --- a/web_src/src/components/CloudRecord.vue +++ b/web_src/src/components/CloudRecord.vue @@ -133,7 +133,7 @@ let that = this; this.$axios({ method: 'get', - url:`./record_proxy/${that.mediaServerId}/api/record/list`, + url:`/record_proxy/${that.mediaServerId}/api/record/list`, params: { page: that.currentPage, count: that.count @@ -185,7 +185,7 @@ let that = this; this.$axios({ method: 'delete', - url:`./record_proxy/api/record/delete`, + url:`/record_proxy/api/record/delete`, params: { page: that.currentPage, count: that.count diff --git a/web_src/src/components/CloudRecordDetail.vue b/web_src/src/components/CloudRecordDetail.vue index 8b3f4c8..40c21b6 100644 --- a/web_src/src/components/CloudRecordDetail.vue +++ b/web_src/src/components/CloudRecordDetail.vue @@ -241,7 +241,7 @@ let that = this; that.$axios({ method: 'get', - url:`./record_proxy/${that.mediaServerId}/api/record/file/list`, + url:`/record_proxy/${that.mediaServerId}/api/record/file/list`, params: { app: that.recordFile.app, stream: that.recordFile.stream, @@ -340,7 +340,7 @@ let that = this; this.$axios({ method: 'delete', - url:`./record_proxy/${that.mediaServerId}/api/record/delete`, + url:`/record_proxy/${that.mediaServerId}/api/record/delete`, params: { page: that.currentPage, count: that.count @@ -359,7 +359,7 @@ that.dateFilesObj = {}; this.$axios({ method: 'get', - url:`./record_proxy/${that.mediaServerId}/api/record/date/list`, + url:`/record_proxy/${that.mediaServerId}/api/record/date/list`, params: { app: that.recordFile.app, stream: that.recordFile.stream @@ -408,7 +408,7 @@ let that = this; this.$axios({ method: 'get', - url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, + url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, params: { app: that.recordFile.app, stream: that.recordFile.stream, @@ -433,7 +433,7 @@ let that = this; this.$axios({ method: 'get', - url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, + url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, params: { isEnd: isEnd, } diff --git a/web_src/src/components/DeviceList.vue b/web_src/src/components/DeviceList.vue index 5f2495e..29e049d 100644 --- a/web_src/src/components/DeviceList.vue +++ b/web_src/src/components/DeviceList.vue @@ -152,7 +152,7 @@ this.getDeviceListLoading = true; this.$axios({ method: 'get', - url: `./api/device/query/devices`, + url: `/api/device/query/devices`, params: { page: this.currentPage, count: this.count @@ -182,7 +182,7 @@ }).then(() => { this.$axios({ method: 'delete', - url: `./api/device/query/devices/${row.deviceId}/delete` + url: `/api/device/query/devices/${row.deviceId}/delete` }).then((res) => { this.getDeviceList(); }).catch((error) => { @@ -208,7 +208,7 @@ let that = this; this.$axios({ method: 'get', - url: './api/device/query/devices/' + itemData.deviceId + '/sync' + url: '/api/device/query/devices/' + itemData.deviceId + '/sync' }).then((res) => { console.log("鍒锋柊璁惧缁撴灉锛�" + JSON.stringify(res)); if (res.data.code !== 0) { @@ -242,7 +242,7 @@ await this.$axios({ method: 'get', async: false, - url: `./api/device/query/${deviceId}/sync_status/`, + url: `/api/device/query/${deviceId}/sync_status/`, }).then((res) => { if (res.data.code == 0) { if (res.data.data.errorMsg !== null) { @@ -261,7 +261,7 @@ let that = this; this.$axios({ method: 'post', - url: './api/device/query/transport/' + row.deviceId + '/' + row.streamMode + url: '/api/device/query/transport/' + row.deviceId + '/' + row.streamMode }).then(function (res) { }).catch(function (e) { diff --git a/web_src/src/components/GBRecordDetail.vue b/web_src/src/components/GBRecordDetail.vue index 938792a..6fe29a8 100644 --- a/web_src/src/components/GBRecordDetail.vue +++ b/web_src/src/components/GBRecordDetail.vue @@ -197,7 +197,7 @@ this.detailFiles = []; this.$axios({ method: 'get', - url: './api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime + url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime }).then((res)=>{ this.recordsLoading = false; if(res.data.code === 0) { @@ -249,7 +249,7 @@ } else { this.$axios({ method: 'get', - url: './api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + + url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime }).then((res)=> { if (res.data.code === 0) { @@ -273,7 +273,7 @@ console.log('鍓嶇鎺у埗锛氭挱鏀�'); this.$axios({ method: 'get', - url: './api/playback/resume/' + this.streamId + url: '/api/playback/resume/' + this.streamId }).then((res)=> { this.$refs["recordVideoPlayer"].play(this.videoUrl) }); @@ -282,14 +282,14 @@ console.log('鍓嶇鎺у埗锛氭殏鍋�'); this.$axios({ method: 'get', - url: './api/playback/pause/' + this.streamId + url: '/api/playback/pause/' + this.streamId }).then(function (res) {}); }, gbScale(command){ console.log('鍓嶇鎺у埗锛氬�嶉�� ' + command); this.$axios({ method: 'get', - url: `./api/playback/speed/${this.streamId }/${command}` + url: `/api/playback/speed/${this.streamId }/${command}` }).then(function (res) {}); }, downloadRecord: function (row) { @@ -311,7 +311,7 @@ }else { this.$axios({ method: 'get', - url: './api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' + + url: '/api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' + row.endTime + '&downloadSpeed=4' }).then( (res)=> { if (res.data.code === 0) { @@ -332,7 +332,7 @@ this.videoUrl = ''; this.$axios({ method: 'get', - url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId + url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId }).then((res)=> { if (callback) callback(res) }); @@ -342,7 +342,7 @@ this.videoUrl = ''; this.$axios({ method: 'get', - url: './api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId + url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId }).then(function (res) { if (callback) callback() }); diff --git a/web_src/src/components/Login.vue b/web_src/src/components/Login.vue index 6346950..37c8a83 100644 --- a/web_src/src/components/Login.vue +++ b/web_src/src/components/Login.vue @@ -81,7 +81,7 @@ this.$axios({ method: 'get', - url:"./api/user/login", + url:"/api/user/login", params: loginParam }).then(function (res) { window.clearTimeout(timeoutTask) diff --git a/web_src/src/components/ParentPlatformList.vue b/web_src/src/components/ParentPlatformList.vue index 262bdda..61e93fc 100644 --- a/web_src/src/components/ParentPlatformList.vue +++ b/web_src/src/components/ParentPlatformList.vue @@ -128,7 +128,7 @@ var that = this; that.$axios({ method: 'delete', - url:`./api/platform/delete/${platform.serverGBId}` + url:`/api/platform/delete/${platform.serverGBId}` }).then(function (res) { if (res.data.code === 0) { that.$message({ @@ -162,7 +162,7 @@ this.$axios({ method: 'get', - url:`./api/platform/query/${that.count}/${that.currentPage}` + url:`/api/platform/query/${that.count}/${that.currentPage}` }).then(function (res) { if (res.data.code === 0) { that.total = res.data.data.total; diff --git a/web_src/src/components/PushVideoList.vue b/web_src/src/components/PushVideoList.vue index 5ca7194..6aed98a 100644 --- a/web_src/src/components/PushVideoList.vue +++ b/web_src/src/components/PushVideoList.vue @@ -171,7 +171,7 @@ this.getDeviceListLoading = true; this.$axios({ method: 'get', - url: `./api/push/list`, + url: `/api/push/list`, params: { page: that.currentPage, count: that.count, @@ -197,7 +197,7 @@ this.getListLoading = true; this.$axios({ method: 'get', - url: './api/push/getPlayUrl', + url: '/api/push/getPlayUrl', params: { app: row.app, stream: row.stream, @@ -223,7 +223,7 @@ let that = this; that.$axios({ method: "post", - url: "./api/push/stop", + url: "/api/push/stop", params: { app: row.app, streamId: row.stream @@ -247,7 +247,7 @@ let that = this; that.$axios({ method: "delete", - url: "./api/push/remove_form_gb", + url: "/api/push/remove_form_gb", data: row }).then((res) => { if (res.data.code === 0) { @@ -274,7 +274,7 @@ let that = this; that.$axios({ method: "delete", - url: "./api/push/batchStop", + url: "/api/push/batchStop", data: { gbStreams: this.multipleSelection } diff --git a/web_src/src/components/StreamProxyList.vue b/web_src/src/components/StreamProxyList.vue index f0cb777..47ccde8 100644 --- a/web_src/src/components/StreamProxyList.vue +++ b/web_src/src/components/StreamProxyList.vue @@ -167,7 +167,7 @@ let that = this; this.$axios({ method: 'get', - url:`./api/proxy/list`, + url:`/api/proxy/list`, params: { page: that.currentPage, count: that.count @@ -190,7 +190,7 @@ addOnvif: function(){ this.$axios({ method: 'get', - url:`./api/onvif/search?timeout=3000`, + url:`/api/onvif/search?timeout=3000`, }).then((res) =>{ if (res.data.code === 0 ){ if (res.data.data.length > 0) { @@ -218,7 +218,7 @@ let that = this; this.$axios({ method: 'get', - url:`./api/push/getPlayUrl`, + url:`/api/push/getPlayUrl`, params: { app: row.app, stream: row.stream, @@ -247,7 +247,7 @@ let that = this; that.$axios({ method:"delete", - url:"./api/proxy/del", + url:"/api/proxy/del", params:{ app: row.app, stream: row.stream @@ -263,7 +263,7 @@ this.$set(row, 'startBtnLoading', true) this.$axios({ method: 'get', - url:`./api/proxy/start`, + url:`/api/proxy/start`, params: { app: row.app, stream: row.stream @@ -295,7 +295,7 @@ let that = this; this.$axios({ method: 'get', - url:`./api/proxy/stop`, + url:`/api/proxy/stop`, params: { app: row.app, stream: row.stream diff --git a/web_src/src/components/UserManager.vue b/web_src/src/components/UserManager.vue index d012b13..c0fa695 100644 --- a/web_src/src/components/UserManager.vue +++ b/web_src/src/components/UserManager.vue @@ -99,7 +99,7 @@ this.getUserListLoading = true; this.$axios({ method: 'get', - url: `./api/user/users`, + url: `/api/user/users`, params: { page: that.currentPage, count: that.count @@ -141,7 +141,7 @@ }).then(() => { this.$axios({ method: 'delete', - url: `./api/user/delete?id=${row.id}` + url: `/api/user/delete?id=${row.id}` }).then((res) => { this.getUserList(); }).catch((error) => { diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index e324bdc..f020f34 100644 --- a/web_src/src/components/channelList.vue +++ b/web_src/src/components/channelList.vue @@ -206,7 +206,7 @@ if (typeof (this.$route.params.deviceId) == "undefined") return; this.$axios({ method: 'get', - url: `./api/device/query/devices/${this.$route.params.deviceId}/channels`, + url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`, params: { page: that.currentPage, count: that.count, @@ -238,7 +238,7 @@ let that = this; this.$axios({ method: 'get', - url: './api/play/start/' + deviceId + '/' + channelId + url: '/api/play/start/' + deviceId + '/' + channelId }).then(function (res) { console.log(res) that.isLoging = false; @@ -278,7 +278,7 @@ var that = this; this.$axios({ method: 'get', - url: './api/play/stop/' + this.deviceId + "/" + itemData.channelId + url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId }).then(function (res) { that.initData(); }).catch(function (error) { @@ -334,7 +334,7 @@ if (!this.showTree) { this.$axios({ method: 'get', - url: `./api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, + url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, params: { page: this.currentPage, count: this.count, @@ -358,7 +358,7 @@ }else { this.$axios({ method: 'get', - url: `./api/device/query/tree/channel/${this.deviceId}`, + url: `/api/device/query/tree/channel/${this.deviceId}`, params: { parentId: this.parentChannelId, page: this.currentPage, @@ -387,7 +387,7 @@ updateChannel: function (row) { this.$axios({ method: 'post', - url: `./api/device/query/channel/update/${this.deviceId}`, + url: `/api/device/query/channel/update/${this.deviceId}`, params: row }).then(function (res) { console.log(JSON.stringify(res)); diff --git a/web_src/src/components/console.vue b/web_src/src/components/console.vue index 2f5bb55..e192fb1 100644 --- a/web_src/src/components/console.vue +++ b/web_src/src/components/console.vue @@ -114,7 +114,7 @@ getSystemInfo: function (){ this.$axios({ method: 'get', - url: `./api/server/system/info`, + url: `/api/server/system/info`, }).then( (res)=> { if (res.data.code === 0) { this.$refs.consoleCPU.setData(res.data.data.cpu) @@ -128,7 +128,7 @@ getLoad: function (){ this.$axios({ method: 'get', - url: `./api/server/media_server/load`, + url: `/api/server/media_server/load`, }).then( (res)=> { if (res.data.code === 0) { this.$refs.consoleNodeLoad.setData(res.data.data) @@ -139,7 +139,7 @@ getResourceInfo: function (){ this.$axios({ method: 'get', - url: `./api/server/resource/info`, + url: `/api/server/resource/info`, }).then( (res)=> { if (res.data.code === 0) { this.$refs.consoleResource.setData(res.data.data) @@ -151,7 +151,7 @@ this.$axios({ method: 'get', - url: `./api/server/system/configInfo`, + url: `/api/server/system/configInfo`, }).then( (res)=> { console.log(res) if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/MediaServerEdit.vue b/web_src/src/components/dialog/MediaServerEdit.vue index edb4ff6..9353a81 100644 --- a/web_src/src/components/dialog/MediaServerEdit.vue +++ b/web_src/src/components/dialog/MediaServerEdit.vue @@ -335,7 +335,7 @@ var that = this; await that.$axios({ method: 'get', - url:`./api/platform/exit/${deviceGbId}` + url:`/api/platform/exit/${deviceGbId}` }).then(function (res) { result = res.data; }).catch(function (error) { diff --git a/web_src/src/components/dialog/StreamProxyEdit.vue b/web_src/src/components/dialog/StreamProxyEdit.vue index c8efc14..76011fa 100644 --- a/web_src/src/components/dialog/StreamProxyEdit.vue +++ b/web_src/src/components/dialog/StreamProxyEdit.vue @@ -195,7 +195,7 @@ let that = this; this.$axios({ method: 'get', - url:`./api/platform/query/10000/1` + url:`/api/platform/query/10000/1` }).then(function (res) { that.platformList = res.data.data.list; }).catch(function (error) { @@ -212,7 +212,7 @@ if (that.proxyParam.mediaServerId !== "auto"){ that.$axios({ method: 'get', - url:`./api/proxy/ffmpeg_cmd/list`, + url:`/api/proxy/ffmpeg_cmd/list`, params: { mediaServerId: that.proxyParam.mediaServerId } @@ -230,7 +230,7 @@ this.noneReaderHandler(); this.$axios({ method: 'post', - url:`./api/proxy/save`, + url:`/api/proxy/save`, data: this.proxyParam }).then((res)=> { this.dialogLoading = false; @@ -261,7 +261,7 @@ var that = this; await that.$axios({ method: 'get', - url:`./api/platform/exit/${deviceGbId}` + url:`/api/platform/exit/${deviceGbId}` }).then(function (res) { result = res.data; }).catch(function (error) { diff --git a/web_src/src/components/dialog/SyncChannelProgress.vue b/web_src/src/components/dialog/SyncChannelProgress.vue index 6f4544b..e1c9fe0 100644 --- a/web_src/src/components/dialog/SyncChannelProgress.vue +++ b/web_src/src/components/dialog/SyncChannelProgress.vue @@ -55,7 +55,7 @@ getProgress(){ this.$axios({ method: 'get', - url:`./api/device/query/${this.deviceId}/sync_status/`, + url:`/api/device/query/${this.deviceId}/sync_status/`, }).then((res) => { if (res.data.code === 0) { if (!this.syncFlag) { diff --git a/web_src/src/components/dialog/addUser.vue b/web_src/src/components/dialog/addUser.vue index 9ac38aa..8dc5682 100644 --- a/web_src/src/components/dialog/addUser.vue +++ b/web_src/src/components/dialog/addUser.vue @@ -100,7 +100,7 @@ onSubmit: function () { this.$axios({ method: 'post', - url: "./api/user/add", + url: "/api/user/add", params: { username: this.username, password: this.password, @@ -139,7 +139,7 @@ this.$axios({ method: 'get', - url: "./api/role/all" + url: "/api/role/all" }).then((res) => { this.loading = true; if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue index da2cc30..e1cd8d2 100644 --- a/web_src/src/components/dialog/catalogEdit.vue +++ b/web_src/src/components/dialog/catalogEdit.vue @@ -116,7 +116,7 @@ console.log(this.form); this.$axios({ method:"post", - url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, + url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, data: this.form }).then((res)=> { if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/changePassword.vue b/web_src/src/components/dialog/changePassword.vue index 9b53b92..77e1d2a 100644 --- a/web_src/src/components/dialog/changePassword.vue +++ b/web_src/src/components/dialog/changePassword.vue @@ -90,7 +90,7 @@ onSubmit: function () { this.$axios({ method: 'post', - url:"./api/user/changePassword", + url:"/api/user/changePassword", params: { oldPassword: crypto.createHash('md5').update(this.oldPassword, "utf8").digest('hex'), password: this.newPassword diff --git a/web_src/src/components/dialog/changePasswordForAdmin.vue b/web_src/src/components/dialog/changePasswordForAdmin.vue index 9c17d56..5b91357 100644 --- a/web_src/src/components/dialog/changePasswordForAdmin.vue +++ b/web_src/src/components/dialog/changePasswordForAdmin.vue @@ -85,7 +85,7 @@ onSubmit: function () { this.$axios({ method: 'post', - url:"./api/user/changePasswordForAdmin", + url:"/api/user/changePasswordForAdmin", params: { password: this.newPassword, userId: this.form.id, diff --git a/web_src/src/components/dialog/changePushKey.vue b/web_src/src/components/dialog/changePushKey.vue index 9cc1684..0b9834e 100644 --- a/web_src/src/components/dialog/changePushKey.vue +++ b/web_src/src/components/dialog/changePushKey.vue @@ -65,7 +65,7 @@ onSubmit: function () { this.$axios({ method: 'post', - url:"./api/user/changePushKey", + url:"/api/user/changePushKey", params: { pushKey: this.newPushKey, userId: this.form.id, diff --git a/web_src/src/components/dialog/channelMapInfobox.vue b/web_src/src/components/dialog/channelMapInfobox.vue index 8304068..2ef0e52 100644 --- a/web_src/src/components/dialog/channelMapInfobox.vue +++ b/web_src/src/components/dialog/channelMapInfobox.vue @@ -44,7 +44,7 @@ let that = this; this.$axios({ method: 'get', - url: './api/play/start/' + deviceId + '/' + channelId + url: '/api/play/start/' + deviceId + '/' + channelId }).then(function (res) { that.isLoging = false; if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/chooseChannel.vue b/web_src/src/components/dialog/chooseChannel.vue index e891839..e0e79c3 100644 --- a/web_src/src/components/dialog/chooseChannel.vue +++ b/web_src/src/components/dialog/chooseChannel.vue @@ -98,7 +98,7 @@ this.$axios({ method:"post", - url:"./api/platform/update_channel_for_gb", + url:"/api/platform/update_channel_for_gb", data:{ platformId: that.platformId, channelReduces: that.chooseData diff --git a/web_src/src/components/dialog/chooseChannelForCatalog.vue b/web_src/src/components/dialog/chooseChannelForCatalog.vue index 82d1f58..c634b77 100644 --- a/web_src/src/components/dialog/chooseChannelForCatalog.vue +++ b/web_src/src/components/dialog/chooseChannelForCatalog.vue @@ -82,7 +82,7 @@ let that = this; this.$axios({ method:"get", - url:`./api/platform/catalog`, + url:`/api/platform/catalog`, params: { platformId: that.platformId, parentId: parentId @@ -134,7 +134,7 @@ removeCatalog: function (id, node){ this.$axios({ method:"delete", - url:`./api/platform/catalog/del`, + url:`/api/platform/catalog/del`, params: { id: id, platformId: this.platformId, @@ -156,7 +156,7 @@ setDefaultCatalog: function (id){ this.$axios({ method:"post", - url:`./api/platform/catalog/default/update`, + url:`/api/platform/catalog/default/update`, params: { platformId: this.platformId, catalogId: id, @@ -201,7 +201,7 @@ onClick: () => { this.$axios({ method:"delete", - url:"./api/platform/catalog/relation/del", + url:"/api/platform/catalog/relation/del", data: data }).then((res)=>{ console.log("绉婚櫎鎴愬姛") diff --git a/web_src/src/components/dialog/chooseChannelForGb.vue b/web_src/src/components/dialog/chooseChannelForGb.vue index 270bcda..fc97b4c 100644 --- a/web_src/src/components/dialog/chooseChannelForGb.vue +++ b/web_src/src/components/dialog/chooseChannelForGb.vue @@ -121,7 +121,7 @@ this.getCatalogFromUser((catalogId)=> { this.$axios({ method:"post", - url:"./api/platform/update_channel_for_gb", + url:"/api/platform/update_channel_for_gb", data:{ platformId: this.platformId, all: all, @@ -149,7 +149,7 @@ this.$axios({ method:"delete", - url:"./api/platform/del_channel_for_gb", + url:"/api/platform/del_channel_for_gb", data:{ platformId: this.platformId, all: all, @@ -248,7 +248,7 @@ this.$axios({ method:"get", - url:`./api/platform/channel_list`, + url:`/api/platform/channel_list`, params: { page: that.currentPage, count: that.count, @@ -290,7 +290,7 @@ }).then(() => { this.$axios({ method:"delete", - url:"./api/platform/del_channel_for_gb", + url:"/api/platform/del_channel_for_gb", data:{ platformId: this.platformId, channelReduces: this.multipleSelection @@ -310,7 +310,7 @@ this.$axios({ method: "post", - url: "./api/platform/update_channel_for_gb", + url: "/api/platform/update_channel_for_gb", data: { platformId: this.platformId, channelReduces: this.multipleSelection, diff --git a/web_src/src/components/dialog/chooseChannelForStream.vue b/web_src/src/components/dialog/chooseChannelForStream.vue index fbf3133..6c4653b 100644 --- a/web_src/src/components/dialog/chooseChannelForStream.vue +++ b/web_src/src/components/dialog/chooseChannelForStream.vue @@ -134,7 +134,7 @@ this.getCatalogFromUser((catalogId)=>{ this.$axios({ method:"post", - url:"./api/gbStream/add", + url:"/api/gbStream/add", data:{ platformId: this.platformId, catalogId: catalogId, @@ -163,7 +163,7 @@ this.$axios({ method:"delete", - url:"./api/gbStream/del", + url:"/api/gbStream/del", data:{ platformId: this.platformId, all: all, @@ -186,7 +186,7 @@ this.$axios({ method: 'get', - url:`./api/gbStream/list`, + url:`/api/gbStream/list`, params: { page: that.currentPage, count: that.count, @@ -222,7 +222,7 @@ }).then(() => { this.$axios({ method:"delete", - url:"./api/gbStream/del", + url:"/api/gbStream/del", data:{ platformId: this.platformId, gbStreams: this.multipleSelection, @@ -242,7 +242,7 @@ this.getCatalogFromUser((catalogId)=>{ this.$axios({ method:"post", - url:"./api/gbStream/add", + url:"/api/gbStream/add", data:{ platformId: this.platformId, catalogId: catalogId, diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue index 9cacc36..8a5f9d1 100644 --- a/web_src/src/components/dialog/deviceEdit.vue +++ b/web_src/src/components/dialog/deviceEdit.vue @@ -131,7 +131,7 @@ this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0 this.$axios({ method: 'post', - url:`./api/device/query/device/${this.isEdit?'update':'add'}/`, + url:`/api/device/query/device/${this.isEdit?'update':'add'}/`, params: this.form }).then((res) => { console.log(res.data) diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue index c7fde47..e83a29c 100644 --- a/web_src/src/components/dialog/devicePlayer.vue +++ b/web_src/src/components/dialog/devicePlayer.vue @@ -320,7 +320,7 @@ if (tab.name === "codec") { this.$axios({ method: 'get', - url: './zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId + url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId }).then(function (res) { that.tracksLoading = false; if (res.data.code == 0 && res.data.tracks) { @@ -397,7 +397,7 @@ this.$refs[this.activePlayer].pause() that.$axios({ method: 'post', - url: './api/play/convert/' + that.streamId + url: '/api/play/convert/' + that.streamId }).then(function (res) { if (res.data.code === 0) { that.convertKey = res.data.key; @@ -434,7 +434,7 @@ that.$refs.videoPlayer.pause() this.$axios({ method: 'post', - url: './api/play/convertStop/' + this.convertKey + url: '/api/play/convertStop/' + this.convertKey }).then(function (res) { if (res.data.code == 0) { console.log(res.data.msg) @@ -494,7 +494,7 @@ let that = this; this.$axios({ method: 'post', - url: './api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed + url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed }).then(function (res) {}); }, //////////////////////鎾斁鍣ㄤ簨浠跺鐞�////////////////////////// @@ -506,7 +506,7 @@ let that = this; this.$axios({ method: 'post', - url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0' + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0' }).then(function (res) {}); }, setSpeedOrTime: function (cmdCode, groupNum, parameter) { @@ -516,7 +516,7 @@ console.log('鍓嶇鎺у埗锛�0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); this.$axios({ method: 'post', - url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2 + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2 }).then(function (res) {}); }, setCommand: function (cmdCode, groupNum, parameter) { @@ -524,7 +524,7 @@ console.log('鍓嶇鎺у埗锛�0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); this.$axios({ method: 'post', - url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0' + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0' }).then(function (res) {}); }, copyUrl: function (dropdownItem){ diff --git a/web_src/src/components/dialog/getCatalog.vue b/web_src/src/components/dialog/getCatalog.vue index 3aae99d..fdc26de 100644 --- a/web_src/src/components/dialog/getCatalog.vue +++ b/web_src/src/components/dialog/getCatalog.vue @@ -89,7 +89,7 @@ let that = this; this.$axios({ method:"get", - url:`./api/platform/catalog`, + url:`/api/platform/catalog`, params: { platformId: that.platformId, parentId: parentId @@ -111,7 +111,7 @@ if (node.level === 0) { this.$axios({ method:"get", - url:`./api/platform/info/` + this.platformId, + url:`/api/platform/info/` + this.platformId, }) .then((res)=> { if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/importChannel.vue b/web_src/src/components/dialog/importChannel.vue index d511fe8..91611e8 100644 --- a/web_src/src/components/dialog/importChannel.vue +++ b/web_src/src/components/dialog/importChannel.vue @@ -60,7 +60,7 @@ console.log(this.form); this.$axios({ method:"post", - url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, + url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, data: this.form }) .then((res)=> { diff --git a/web_src/src/components/dialog/onvifEdit.vue b/web_src/src/components/dialog/onvifEdit.vue index 8a68b20..f36ce4a 100644 --- a/web_src/src/components/dialog/onvifEdit.vue +++ b/web_src/src/components/dialog/onvifEdit.vue @@ -81,7 +81,7 @@ console.log(this.form); this.$axios({ method: 'get', - url:`./api/onvif/rtsp`, + url:`/api/onvif/rtsp`, params: { hostname: this.form.hostName, timeout: 3000, diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index a6ced30..7638232 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -138,7 +138,7 @@ showDialog: false, isLoging: false, onSubmit_text: "绔嬪嵆鍒涘缓", - saveUrl: "./api/platform/save", + saveUrl: "/api/platform/save", platform: { id: null, @@ -192,7 +192,7 @@ this.saveUrl = "/api/platform/add"; this.$axios({ method: 'get', - url:`./api/platform/server_config` + url:`/api/platform/server_config` }).then(function (res) { console.log(res); if (res.data.code === 0) { @@ -315,7 +315,7 @@ var that = this; await that.$axios({ method: 'get', - url:`./api/platform/exit/${deviceGbId}`}) + url:`/api/platform/exit/${deviceGbId}`}) .then(function (res) { if (res.data.code === 0) { result = res.data.data; diff --git a/web_src/src/components/dialog/pushStreamEdit.vue b/web_src/src/components/dialog/pushStreamEdit.vue index 2e632b5..de4e7bc 100644 --- a/web_src/src/components/dialog/pushStreamEdit.vue +++ b/web_src/src/components/dialog/pushStreamEdit.vue @@ -109,7 +109,7 @@ if (this.edit) { this.$axios({ method:"post", - url:`./api/push/save_to_gb`, + url:`/api/push/save_to_gb`, data: this.proxyParam }).then( (res) => { if (res.data.code === 0) { @@ -129,7 +129,7 @@ }else { this.$axios({ method:"post", - url:`./api/push/add`, + url:`/api/push/add`, data: this.proxyParam }).then( (res) => { if (res.data.code === 0) { @@ -159,7 +159,7 @@ var that = this; await that.$axios({ method:"get", - url:`./api/platform/exit/${deviceGbId}` + url:`/api/platform/exit/${deviceGbId}` }).then(function (res) { result = res.data; }).catch(function (error) { diff --git a/web_src/src/components/dialog/queryTrace.vue b/web_src/src/components/dialog/queryTrace.vue index fcd1c10..5063ad4 100644 --- a/web_src/src/components/dialog/queryTrace.vue +++ b/web_src/src/components/dialog/queryTrace.vue @@ -72,7 +72,7 @@ onSubmit: function () { console.log("onSubmit"); this.isLoging = true; - let url = `./api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`; + let url = `/api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`; if (this.channel.channelId) { url+="&channelId=${this.channel.channelId}" } diff --git a/web_src/src/components/dialog/recordDownload.vue b/web_src/src/components/dialog/recordDownload.vue index 4677487..3e8c427 100644 --- a/web_src/src/components/dialog/recordDownload.vue +++ b/web_src/src/components/dialog/recordDownload.vue @@ -71,7 +71,7 @@ getProgress: function (callback){ this.$axios({ method: 'get', - url: `./api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}` + url: `/api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}` }).then((res)=> { console.log(res) if (res.data.code === 0) { @@ -124,7 +124,7 @@ stopDownloadRecord: function (callback) { this.$axios({ method: 'get', - url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream + url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream }).then((res)=> { if (callback) callback(res) }); @@ -132,7 +132,7 @@ getFileDownload: function (){ this.$axios({ method: 'get', - url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/add`, + url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/add`, params: { app: this.app, stream: this.stream, @@ -164,7 +164,7 @@ getProgressForFile: function (callback){ this.$axios({ method: 'get', - url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/list`, + url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/list`, params: { app: this.app, stream: this.stream, diff --git a/web_src/src/components/live.vue b/web_src/src/components/live.vue index a691418..4a7af49 100644 --- a/web_src/src/components/live.vue +++ b/web_src/src/components/live.vue @@ -135,7 +135,7 @@ this.loading = true this.$axios({ method: 'get', - url: './api/play/start/' + deviceId + '/' + channelId + url: '/api/play/start/' + deviceId + '/' + channelId }).then(function (res) { if (res.data.code === 0 && res.data.data) { let videoUrl; diff --git a/web_src/src/components/map.vue b/web_src/src/components/map.vue index 20adff0..2aa17f6 100644 --- a/web_src/src/components/map.vue +++ b/web_src/src/components/map.vue @@ -298,7 +298,7 @@ let that = this; this.$axios({ method: 'get', - url: './api/play/start/' + deviceId + '/' + channelId + url: '/api/play/start/' + deviceId + '/' + channelId }).then(function (res) { that.isLoging = false; if (res.data.code === 0) { diff --git a/web_src/src/components/service/DeviceService.js b/web_src/src/components/service/DeviceService.js index 61314fe..85d36f8 100644 --- a/web_src/src/components/service/DeviceService.js +++ b/web_src/src/components/service/DeviceService.js @@ -9,7 +9,7 @@ getDeviceList(currentPage, count, callback, errorCallback){ this.$axios({ method: 'get', - url:`./api/device/query/devices`, + url:`/api/device/query/devices`, params: { page: currentPage, count: count @@ -25,7 +25,7 @@ getDevice(deviceId, callback, errorCallback){ this.$axios({ method: 'get', - url:`./api/device/query/devices/${deviceId}`, + url:`/api/device/query/devices/${deviceId}`, }).then((res) => { if (typeof (callback) == "function") callback(res.data) }).catch((error) => { @@ -82,7 +82,7 @@ getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) { this.$axios({ method: 'get', - url: `./api/device/query/devices/${deviceId}/channels`, + url: `/api/device/query/devices/${deviceId}/channels`, params:{ page: currentPage, count: count, @@ -121,7 +121,7 @@ getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) { this.$axios({ method: 'get', - url: `./api/device/query/sub_channels/${deviceId}/${channelId}/channels`, + url: `/api/device/query/sub_channels/${deviceId}/${channelId}/channels`, params:{ page: currentPage, count: count, @@ -161,7 +161,7 @@ } this.$axios({ method: 'get', - url: `./api/device/query/tree/${deviceId}`, + url: `/api/device/query/tree/${deviceId}`, params:{ page: currentPage, count: count, diff --git a/web_src/src/components/service/MediaServer.js b/web_src/src/components/service/MediaServer.js index a2f306c..d4446f0 100644 --- a/web_src/src/components/service/MediaServer.js +++ b/web_src/src/components/service/MediaServer.js @@ -9,7 +9,7 @@ getOnlineMediaServerList(callback){ this.$axios({ method: 'get', - url:`./api/server/media_server/online/list`, + url:`/api/server/media_server/online/list`, }).then((res) => { if (typeof (callback) == "function") callback(res.data) }).catch((error) => { @@ -19,7 +19,7 @@ getMediaServerList(callback){ this.$axios({ method: 'get', - url:`./api/server/media_server/list`, + url:`/api/server/media_server/list`, }).then(function (res) { if (typeof (callback) == "function") callback(res.data) }).catch(function (error) { @@ -30,7 +30,7 @@ getMediaServer(id, callback){ this.$axios({ method: 'get', - url:`./api/server/media_server/one/` + id, + url:`/api/server/media_server/one/` + id, }).then(function (res) { if (typeof (callback) == "function") callback(res.data) }).catch(function (error) { @@ -41,7 +41,7 @@ checkServer(param, callback){ this.$axios({ method: 'get', - url:`./api/server/media_server/check`, + url:`/api/server/media_server/check`, params: { ip: param.ip, port: param.httpPort, @@ -57,7 +57,7 @@ checkRecordServer(param, callback){ this.$axios({ method: 'get', - url:`./api/server/media_server/record/check`, + url:`/api/server/media_server/record/check`, params: { ip: param.ip, port: param.recordAssistPort @@ -72,7 +72,7 @@ addServer(param, callback){ this.$axios({ method: 'post', - url:`./api/server/media_server/save`, + url:`/api/server/media_server/save`, data: param }).then(function (res) { if (typeof (callback) == "function") callback(res.data) @@ -84,7 +84,7 @@ delete(id, callback) { this.$axios({ method: 'delete', - url:`./api/server/media_server/delete`, + url:`/api/server/media_server/delete`, params: { id: id } diff --git a/web_src/src/main.js b/web_src/src/main.js index e800718..91bbd47 100644 --- a/web_src/src/main.js +++ b/web_src/src/main.js @@ -37,13 +37,13 @@ Vue.use(ElementUI); Vue.use(VueCookies); Vue.use(VueClipboards); -Vue.prototype.$axios = axios; + Vue.prototype.$notify = Notification; Vue.use(Contextmenu); Vue.use(VCharts); -axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : ""; - +axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : (window.baseUrl?window.baseUrl:""); +axios.defaults.withCredentials = true; // api 杩斿洖401鑷姩鍥炵櫥闄嗛〉闈� axios.interceptors.response.use(function (response) { // 瀵瑰搷搴旀暟鎹仛鐐逛粈涔� @@ -56,7 +56,7 @@ } return Promise.reject(error); }); - +Vue.prototype.$axios = axios; Vue.prototype.$cookies.config(60*30); new Vue({ diff --git a/web_src/static/js/mapConfig.js b/web_src/static/js/config.js similarity index 95% rename from web_src/static/js/mapConfig.js rename to web_src/static/js/config.js index 60427e8..94a1056 100644 --- a/web_src/static/js/mapConfig.js +++ b/web_src/static/js/config.js @@ -1,3 +1,6 @@ + +window.baseUrl = "" + // map缁勪欢鍏ㄥ眬鍙傛暟, 娉ㄩ噴姝ゅ唴瀹瑰彲浠ュ叧闂湴鍥惧姛鑳� window.mapParam = { // 寮�鍚�/鍏抽棴鍦板浘鍔熻兘 -- Gitblit v1.8.0