Commit a7c3cf531640bb59aa90cb476b8c21db97f41ddb

Authored by 648540858
1 parent a5d9afeb

优化跨域配置,支持同域的前后端分离部署

Showing 71 changed files with 173 additions and 191 deletions
doc/_content/ability/gis.md
@@ -14,7 +14,7 @@ WVP提供了简单的电子地图用于设备的定位以及移动设备的轨 @@ -14,7 +14,7 @@ WVP提供了简单的电子地图用于设备的定位以及移动设备的轨
14 PS: 目前的底图仅用用作演示和学习,商用情况请自行购买授权使用。 14 PS: 目前的底图仅用用作演示和学习,商用情况请自行购买授权使用。
15 15
16 ### 更换底图以及底图配置 16 ### 更换底图以及底图配置
17 -目前WVP支持使用了更换底图,配置文件在web_src/static/js/mapConfig.js,请修改后重新编译前端文件。 17 +目前WVP支持使用了更换底图,配置文件在web_src/static/js/config.js,请修改后重新编译前端文件。
18 ```javascript 18 ```javascript
19 window.mapParam = { 19 window.mapParam = {
20 // 开启/关闭地图功能 20 // 开启/关闭地图功能
src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java
@@ -48,6 +48,13 @@ public class ApiAccessFilter extends OncePerRequestFilter { @@ -48,6 +48,13 @@ public class ApiAccessFilter extends OncePerRequestFilter {
48 long start = System.currentTimeMillis(); // 请求进入时间 48 long start = System.currentTimeMillis(); // 请求进入时间
49 String uriName = ApiSaveConstant.getVal(servletRequest.getRequestURI()); 49 String uriName = ApiSaveConstant.getVal(servletRequest.getRequestURI());
50 50
  51 + String origin = servletRequest.getHeader("Origin");
  52 + servletResponse.setContentType("application/json;charset=UTF-8");
  53 + servletResponse.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*");
  54 + servletResponse.setHeader("Access-Control-Allow-Credentials", "true");
  55 + servletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT");
  56 + servletResponse.setHeader("Access-Control-Max-Age", "3600");
  57 + servletResponse.setHeader("Access-Control-Allow-Headers", "token,Content-Type,Content-Length, Authorization, Accept,X-Requested-With,domain,zdy");
51 filterChain.doFilter(servletRequest, servletResponse); 58 filterChain.doFilter(servletRequest, servletResponse);
52 59
53 if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) { 60 if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) {
@@ -65,9 +72,7 @@ public class ApiAccessFilter extends OncePerRequestFilter { @@ -65,9 +72,7 @@ public class ApiAccessFilter extends OncePerRequestFilter {
65 logDto.setUri(servletRequest.getRequestURI()); 72 logDto.setUri(servletRequest.getRequestURI());
66 logDto.setCreateTime(DateUtil.getNow()); 73 logDto.setCreateTime(DateUtil.getNow());
67 logService.add(logDto); 74 logService.add(logDto);
68 -// logger.warn("[Api Access] [{}] [{}] [{}] [{}] [{}] {}ms",  
69 -// uriName, servletRequest.getMethod(), servletRequest.getRequestURI(), servletRequest.getRemoteAddr(), HttpStatus.valueOf(servletResponse.getStatus()),  
70 -// System.currentTimeMillis() - start); 75 +
71 76
72 } 77 }
73 } 78 }
src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java
@@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf.security; @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf.security;
2 2
3 import com.alibaba.fastjson2.JSONObject; 3 import com.alibaba.fastjson2.JSONObject;
4 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 4 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
5 -import org.apache.poi.hssf.eventmodel.ERFListener;  
6 import org.slf4j.Logger; 5 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 6 import org.slf4j.LoggerFactory;
8 import org.springframework.security.core.AuthenticationException; 7 import org.springframework.security.core.AuthenticationException;
@@ -25,7 +24,10 @@ public class AnonymousAuthenticationEntryPoint implements AuthenticationEntryPoi @@ -25,7 +24,10 @@ public class AnonymousAuthenticationEntryPoint implements AuthenticationEntryPoi
25 @Override 24 @Override
26 public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) { 25 public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
27 // 允许跨域 26 // 允许跨域
28 - response.setHeader("Access-Control-Allow-Origin", "*"); 27 + String origin = request.getHeader("Origin");
  28 + response.setHeader("Access-Control-Allow-Credentials", "true");
  29 + response.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*");
  30 + response.setHeader("Access-Control-Allow-Methods", "PUT,POST, GET,DELETE,OPTIONS");
29 // 允许自定义请求头token(允许head跨域) 31 // 允许自定义请求头token(允许head跨域)
30 response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified"); 32 response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified");
31 response.setHeader("Content-type", "application/json;charset=UTF-8"); 33 response.setHeader("Content-type", "application/json;charset=UTF-8");
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -112,6 +112,7 @@ public class ZLMHttpHookListener { @@ -112,6 +112,7 @@ public class ZLMHttpHookListener {
112 * 服务器定时上报时间,上报间隔可配置,默认10s上报一次 112 * 服务器定时上报时间,上报间隔可配置,默认10s上报一次
113 */ 113 */
114 @ResponseBody 114 @ResponseBody
  115 +
115 @PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8") 116 @PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8")
116 public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveHookParam param) { 117 public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveHookParam param) {
117 118
@@ -135,6 +136,7 @@ public class ZLMHttpHookListener { @@ -135,6 +136,7 @@ public class ZLMHttpHookListener {
135 * 播放器鉴权事件,rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件。 136 * 播放器鉴权事件,rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件。
136 */ 137 */
137 @ResponseBody 138 @ResponseBody
  139 +
138 @PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8") 140 @PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8")
139 public HookResult onPlay(@RequestBody OnPlayHookParam param) { 141 public HookResult onPlay(@RequestBody OnPlayHookParam param) {
140 if (logger.isDebugEnabled()) { 142 if (logger.isDebugEnabled()) {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
@@ -30,7 +30,7 @@ import java.util.UUID; @@ -30,7 +30,7 @@ import java.util.UUID;
30 * 位置信息管理 30 * 位置信息管理
31 */ 31 */
32 @Tag(name = "位置信息管理") 32 @Tag(name = "位置信息管理")
33 -@CrossOrigin 33 +
34 @RestController 34 @RestController
35 @RequestMapping("/api/position") 35 @RequestMapping("/api/position")
36 public class MobilePositionController { 36 public class MobilePositionController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
@@ -17,7 +17,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; @@ -17,7 +17,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
17 * @data: 2021-01-20 17 * @data: 2021-01-20
18 */ 18 */
19 @Tag(name = "SSE推送") 19 @Tag(name = "SSE推送")
20 -@CrossOrigin 20 +
21 @Controller 21 @Controller
22 @RequestMapping("/api") 22 @RequestMapping("/api")
23 public class SseController { 23 public class SseController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java
@@ -6,24 +6,18 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; @@ -6,24 +6,18 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
6 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; 6 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
7 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; 7 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
8 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; 8 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
9 -import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener;  
10 import com.genersoft.iot.vmp.service.IDeviceAlarmService; 9 import com.genersoft.iot.vmp.service.IDeviceAlarmService;
11 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 10 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
12 import com.genersoft.iot.vmp.utils.DateUtil; 11 import com.genersoft.iot.vmp.utils.DateUtil;
13 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 12 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
14 -import com.genersoft.iot.vmp.vmanager.bean.WVPResult;  
15 import com.github.pagehelper.PageInfo; 13 import com.github.pagehelper.PageInfo;
16 import io.swagger.v3.oas.annotations.Operation; 14 import io.swagger.v3.oas.annotations.Operation;
17 import io.swagger.v3.oas.annotations.Parameter; 15 import io.swagger.v3.oas.annotations.Parameter;
18 -import io.swagger.v3.oas.annotations.responses.ApiResponse;  
19 import io.swagger.v3.oas.annotations.tags.Tag; 16 import io.swagger.v3.oas.annotations.tags.Tag;
20 import org.slf4j.Logger; 17 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 18 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.factory.annotation.Autowired; 19 import org.springframework.beans.factory.annotation.Autowired;
23 -import org.springframework.http.HttpStatus;  
24 -import org.springframework.http.ResponseEntity;  
25 import org.springframework.util.ObjectUtils; 20 import org.springframework.util.ObjectUtils;
26 -import org.springframework.util.StringUtils;  
27 import org.springframework.web.bind.annotation.*; 21 import org.springframework.web.bind.annotation.*;
28 22
29 import javax.sip.InvalidArgumentException; 23 import javax.sip.InvalidArgumentException;
@@ -34,7 +28,7 @@ import java.util.Arrays; @@ -34,7 +28,7 @@ import java.util.Arrays;
34 import java.util.List; 28 import java.util.List;
35 29
36 @Tag(name = "报警信息管理") 30 @Tag(name = "报警信息管理")
37 -@CrossOrigin 31 +
38 @RestController 32 @RestController
39 @RequestMapping("/api/alarm") 33 @RequestMapping("/api/alarm")
40 public class AlarmController { 34 public class AlarmController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java
@@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; @@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
14 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; 14 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
15 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; 15 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
16 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 16 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
17 -  
18 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 17 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
19 import io.swagger.v3.oas.annotations.Operation; 18 import io.swagger.v3.oas.annotations.Operation;
20 import io.swagger.v3.oas.annotations.Parameter; 19 import io.swagger.v3.oas.annotations.Parameter;
@@ -22,9 +21,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; @@ -22,9 +21,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
22 import org.slf4j.Logger; 21 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory; 22 import org.slf4j.LoggerFactory;
24 import org.springframework.beans.factory.annotation.Autowired; 23 import org.springframework.beans.factory.annotation.Autowired;
25 -import org.springframework.http.ResponseEntity;  
26 import org.springframework.util.ObjectUtils; 24 import org.springframework.util.ObjectUtils;
27 -import org.springframework.util.StringUtils;  
28 import org.springframework.web.bind.annotation.*; 25 import org.springframework.web.bind.annotation.*;
29 import org.springframework.web.context.request.async.DeferredResult; 26 import org.springframework.web.context.request.async.DeferredResult;
30 27
@@ -34,7 +31,7 @@ import java.text.ParseException; @@ -34,7 +31,7 @@ import java.text.ParseException;
34 import java.util.UUID; 31 import java.util.UUID;
35 32
36 @Tag(name = "国标设备配置") 33 @Tag(name = "国标设备配置")
37 -@CrossOrigin 34 +
38 @RestController 35 @RestController
39 @RequestMapping("/api/device/config") 36 @RequestMapping("/api/device/config")
40 public class DeviceConfig { 37 public class DeviceConfig {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java
@@ -32,7 +32,7 @@ import java.text.ParseException; @@ -32,7 +32,7 @@ import java.text.ParseException;
32 import java.util.UUID; 32 import java.util.UUID;
33 33
34 @Tag(name = "国标设备控制") 34 @Tag(name = "国标设备控制")
35 -@CrossOrigin 35 +
36 @RestController 36 @RestController
37 @RequestMapping("/api/device/control") 37 @RequestMapping("/api/device/control")
38 public class DeviceControl { 38 public class DeviceControl {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
@@ -46,7 +46,7 @@ import java.util.*; @@ -46,7 +46,7 @@ import java.util.*;
46 46
47 @Tag(name = "国标设备查询", description = "国标设备查询") 47 @Tag(name = "国标设备查询", description = "国标设备查询")
48 @SuppressWarnings("rawtypes") 48 @SuppressWarnings("rawtypes")
49 -@CrossOrigin 49 +
50 @RestController 50 @RestController
51 @RequestMapping("/api/device/query") 51 @RequestMapping("/api/device/query")
52 public class DeviceQuery { 52 public class DeviceQuery {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*; @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
17 import java.util.List; 17 import java.util.List;
18 18
19 @Tag(name = "视频流关联到级联平台") 19 @Tag(name = "视频流关联到级联平台")
20 -@CrossOrigin 20 +
21 @RestController 21 @RestController
22 @RequestMapping("/api/gbStream") 22 @RequestMapping("/api/gbStream")
23 public class GbStreamController { 23 public class GbStreamController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
@@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest; @@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest;
24 24
25 @Tag(name = "媒体流相关") 25 @Tag(name = "媒体流相关")
26 @Controller 26 @Controller
27 -@CrossOrigin 27 +
28 @RequestMapping(value = "/api/media") 28 @RequestMapping(value = "/api/media")
29 public class MediaController { 29 public class MediaController {
30 30
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -37,7 +37,7 @@ import java.util.List; @@ -37,7 +37,7 @@ import java.util.List;
37 * 级联平台管理 37 * 级联平台管理
38 */ 38 */
39 @Tag(name = "级联平台管理") 39 @Tag(name = "级联平台管理")
40 -@CrossOrigin 40 +
41 @RestController 41 @RestController
42 @RequestMapping("/api/platform") 42 @RequestMapping("/api/platform")
43 public class PlatformController { 43 public class PlatformController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
@@ -40,7 +40,7 @@ import java.util.List; @@ -40,7 +40,7 @@ import java.util.List;
40 import java.util.UUID; 40 import java.util.UUID;
41 41
42 @Tag(name = "国标设备点播") 42 @Tag(name = "国标设备点播")
43 -@CrossOrigin 43 +
44 @RestController 44 @RestController
45 @RequestMapping("/api/play") 45 @RequestMapping("/api/play")
46 public class PlayController { 46 public class PlayController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
@@ -40,7 +40,7 @@ import java.util.UUID; @@ -40,7 +40,7 @@ import java.util.UUID;
40 * @author lin 40 * @author lin
41 */ 41 */
42 @Tag(name = "视频回放") 42 @Tag(name = "视频回放")
43 -@CrossOrigin 43 +
44 @RestController 44 @RestController
45 @RequestMapping("/api/playback") 45 @RequestMapping("/api/playback")
46 public class PlaybackController { 46 public class PlaybackController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java
1 package com.genersoft.iot.vmp.vmanager.gb28181.ptz; 1 package com.genersoft.iot.vmp.vmanager.gb28181.ptz;
2 2
3 - 3 +
4 import com.genersoft.iot.vmp.conf.exception.ControllerException; 4 import com.genersoft.iot.vmp.conf.exception.ControllerException;
  5 +import com.genersoft.iot.vmp.gb28181.bean.Device;
  6 +import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
  7 +import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
  8 +import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
  9 +import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
5 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 10 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
6 import io.swagger.v3.oas.annotations.Operation; 11 import io.swagger.v3.oas.annotations.Operation;
7 import io.swagger.v3.oas.annotations.Parameter; 12 import io.swagger.v3.oas.annotations.Parameter;
@@ -10,23 +15,16 @@ import org.slf4j.Logger; @@ -10,23 +15,16 @@ import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory; 15 import org.slf4j.LoggerFactory;
11 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.util.ObjectUtils; 17 import org.springframework.util.ObjectUtils;
13 -import org.springframework.util.StringUtils;  
14 import org.springframework.web.bind.annotation.*; 18 import org.springframework.web.bind.annotation.*;
15 import org.springframework.web.context.request.async.DeferredResult; 19 import org.springframework.web.context.request.async.DeferredResult;
16 20
17 -import com.genersoft.iot.vmp.gb28181.bean.Device;  
18 -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;  
19 -import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;  
20 -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;  
21 -import com.genersoft.iot.vmp.storager.IVideoManagerStorage;  
22 -  
23 import javax.sip.InvalidArgumentException; 21 import javax.sip.InvalidArgumentException;
24 import javax.sip.SipException; 22 import javax.sip.SipException;
25 import java.text.ParseException; 23 import java.text.ParseException;
26 import java.util.UUID; 24 import java.util.UUID;
27 25
28 @Tag(name = "云台控制") 26 @Tag(name = "云台控制")
29 -@CrossOrigin 27 +
30 @RestController 28 @RestController
31 @RequestMapping("/api/ptz") 29 @RequestMapping("/api/ptz")
32 public class PtzController { 30 public class PtzController {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java
@@ -36,7 +36,7 @@ import java.text.ParseException; @@ -36,7 +36,7 @@ import java.text.ParseException;
36 import java.util.UUID; 36 import java.util.UUID;
37 37
38 @Tag(name = "国标录像") 38 @Tag(name = "国标录像")
39 -@CrossOrigin 39 +
40 @RestController 40 @RestController
41 @RequestMapping("/api/gb_record") 41 @RequestMapping("/api/gb_record")
42 public class GBRecordController { 42 public class GBRecordController {
src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java
@@ -6,25 +6,18 @@ import com.genersoft.iot.vmp.service.ILogService; @@ -6,25 +6,18 @@ import com.genersoft.iot.vmp.service.ILogService;
6 import com.genersoft.iot.vmp.storager.dao.dto.LogDto; 6 import com.genersoft.iot.vmp.storager.dao.dto.LogDto;
7 import com.genersoft.iot.vmp.utils.DateUtil; 7 import com.genersoft.iot.vmp.utils.DateUtil;
8 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 8 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
9 -import com.genersoft.iot.vmp.vmanager.bean.WVPResult;  
10 import com.github.pagehelper.PageInfo; 9 import com.github.pagehelper.PageInfo;
11 -  
12 import io.swagger.v3.oas.annotations.Operation; 10 import io.swagger.v3.oas.annotations.Operation;
13 import io.swagger.v3.oas.annotations.Parameter; 11 import io.swagger.v3.oas.annotations.Parameter;
14 import io.swagger.v3.oas.annotations.tags.Tag; 12 import io.swagger.v3.oas.annotations.tags.Tag;
15 import org.slf4j.Logger; 13 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory; 14 import org.slf4j.LoggerFactory;
17 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
18 -import org.springframework.http.HttpStatus;  
19 -import org.springframework.http.ResponseEntity;  
20 import org.springframework.util.ObjectUtils; 16 import org.springframework.util.ObjectUtils;
21 -import org.springframework.util.StringUtils;  
22 import org.springframework.web.bind.annotation.*; 17 import org.springframework.web.bind.annotation.*;
23 18
24 -import java.text.ParseException;  
25 -  
26 @Tag(name = "日志管理") 19 @Tag(name = "日志管理")
27 -@CrossOrigin 20 +
28 @RestController 21 @RestController
29 @RequestMapping("/api/log") 22 @RequestMapping("/api/log")
30 public class LogController { 23 public class LogController {
src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 //import org.springframework.web.bind.annotation.*; 14 //import org.springframework.web.bind.annotation.*;
15 // 15 //
16 //@Tag(name = "云端录像") 16 //@Tag(name = "云端录像")
17 -//@CrossOrigin 17 +//
18 //@RestController 18 //@RestController
19 //@RequestMapping("/api/record") 19 //@RequestMapping("/api/record")
20 //public class RecordController { 20 //public class RecordController {
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
@@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.vmanager.server; @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.vmanager.server;
2 2
3 import com.alibaba.fastjson2.JSON; 3 import com.alibaba.fastjson2.JSON;
4 import com.alibaba.fastjson2.JSONObject; 4 import com.alibaba.fastjson2.JSONObject;
5 -import com.genersoft.iot.vmp.VManageBootstrap;  
6 import com.genersoft.iot.vmp.common.SystemAllInfo; 5 import com.genersoft.iot.vmp.common.SystemAllInfo;
7 import com.genersoft.iot.vmp.common.VersionPo; 6 import com.genersoft.iot.vmp.common.VersionPo;
8 import com.genersoft.iot.vmp.conf.SipConfig; 7 import com.genersoft.iot.vmp.conf.SipConfig;
@@ -15,13 +14,10 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; @@ -15,13 +14,10 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
15 import com.genersoft.iot.vmp.service.*; 14 import com.genersoft.iot.vmp.service.*;
16 import com.genersoft.iot.vmp.service.bean.MediaServerLoad; 15 import com.genersoft.iot.vmp.service.bean.MediaServerLoad;
17 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 16 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
18 -import com.genersoft.iot.vmp.utils.SpringBeanFactory;  
19 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 17 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
20 import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; 18 import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
21 import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; 19 import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo;
22 import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; 20 import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo;
23 -import gov.nist.javax.sip.SipStackImpl;  
24 -  
25 import io.swagger.v3.oas.annotations.Operation; 21 import io.swagger.v3.oas.annotations.Operation;
26 import io.swagger.v3.oas.annotations.Parameter; 22 import io.swagger.v3.oas.annotations.Parameter;
27 import io.swagger.v3.oas.annotations.tags.Tag; 23 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -31,14 +27,12 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -31,14 +27,12 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
31 import org.springframework.util.ObjectUtils; 27 import org.springframework.util.ObjectUtils;
32 import org.springframework.web.bind.annotation.*; 28 import org.springframework.web.bind.annotation.*;
33 29
34 -import javax.sip.ListeningPoint;  
35 -import javax.sip.ObjectInUseException;  
36 -import javax.sip.SipProvider;  
37 -import java.util.*; 30 +import java.util.ArrayList;
  31 +import java.util.List;
38 32
39 @SuppressWarnings("rawtypes") 33 @SuppressWarnings("rawtypes")
40 @Tag(name = "服务控制") 34 @Tag(name = "服务控制")
41 -@CrossOrigin 35 +
42 @RestController 36 @RestController
43 @RequestMapping("/api/server") 37 @RequestMapping("/api/server")
44 public class ServerController { 38 public class ServerController {
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*; @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*;
25 */ 25 */
26 @Tag(name = "拉流代理", description = "") 26 @Tag(name = "拉流代理", description = "")
27 @Controller 27 @Controller
28 -@CrossOrigin 28 +
29 @RequestMapping(value = "/api/proxy") 29 @RequestMapping(value = "/api/proxy")
30 public class StreamProxyController { 30 public class StreamProxyController {
31 31
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
@@ -41,7 +41,7 @@ import java.util.UUID; @@ -41,7 +41,7 @@ import java.util.UUID;
41 41
42 @Tag(name = "推流信息管理") 42 @Tag(name = "推流信息管理")
43 @Controller 43 @Controller
44 -@CrossOrigin 44 +
45 @RequestMapping(value = "/api/push") 45 @RequestMapping(value = "/api/push")
46 public class StreamPushController { 46 public class StreamPushController {
47 47
src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java
@@ -6,20 +6,16 @@ import com.genersoft.iot.vmp.service.IRoleService; @@ -6,20 +6,16 @@ import com.genersoft.iot.vmp.service.IRoleService;
6 import com.genersoft.iot.vmp.storager.dao.dto.Role; 6 import com.genersoft.iot.vmp.storager.dao.dto.Role;
7 import com.genersoft.iot.vmp.utils.DateUtil; 7 import com.genersoft.iot.vmp.utils.DateUtil;
8 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 8 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
9 -import com.genersoft.iot.vmp.vmanager.bean.WVPResult;  
10 -  
11 import io.swagger.v3.oas.annotations.Operation; 9 import io.swagger.v3.oas.annotations.Operation;
12 import io.swagger.v3.oas.annotations.Parameter; 10 import io.swagger.v3.oas.annotations.Parameter;
13 import io.swagger.v3.oas.annotations.tags.Tag; 11 import io.swagger.v3.oas.annotations.tags.Tag;
14 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
15 -import org.springframework.http.HttpStatus;  
16 -import org.springframework.http.ResponseEntity;  
17 import org.springframework.web.bind.annotation.*; 13 import org.springframework.web.bind.annotation.*;
18 14
19 import java.util.List; 15 import java.util.List;
20 16
21 @Tag(name = "角色管理") 17 @Tag(name = "角色管理")
22 -@CrossOrigin 18 +
23 @RestController 19 @RestController
24 @RequestMapping("/api/role") 20 @RequestMapping("/api/role")
25 public class RoleController { 21 public class RoleController {
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
@@ -24,7 +24,7 @@ import javax.security.sasl.AuthenticationException; @@ -24,7 +24,7 @@ import javax.security.sasl.AuthenticationException;
24 import java.util.List; 24 import java.util.List;
25 25
26 @Tag(name = "用户管理") 26 @Tag(name = "用户管理")
27 -@CrossOrigin 27 +
28 @RestController 28 @RestController
29 @RequestMapping("/api/user") 29 @RequestMapping("/api/user")
30 public class UserController { 30 public class UserController {
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java
@@ -18,7 +18,7 @@ import java.text.ParseException; @@ -18,7 +18,7 @@ import java.text.ParseException;
18 /** 18 /**
19 * API兼容:设备控制 19 * API兼容:设备控制
20 */ 20 */
21 -@CrossOrigin 21 +
22 @RestController 22 @RestController
23 @RequestMapping(value = "/api/v1/control") 23 @RequestMapping(value = "/api/v1/control")
24 public class ApiControlController { 24 public class ApiControlController {
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java
@@ -6,7 +6,6 @@ import org.slf4j.Logger; @@ -6,7 +6,6 @@ import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 6 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Controller; 8 import org.springframework.stereotype.Controller;
9 -import org.springframework.web.bind.annotation.CrossOrigin;  
10 import org.springframework.web.bind.annotation.RequestMapping; 9 import org.springframework.web.bind.annotation.RequestMapping;
11 import org.springframework.web.bind.annotation.ResponseBody; 10 import org.springframework.web.bind.annotation.ResponseBody;
12 11
@@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; @@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
14 * API兼容:系统接口 13 * API兼容:系统接口
15 */ 14 */
16 @Controller 15 @Controller
17 -@CrossOrigin 16 +
18 @RequestMapping(value = "/api/v1") 17 @RequestMapping(value = "/api/v1")
19 public class ApiController { 18 public class ApiController {
20 19
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
@@ -20,7 +20,7 @@ import java.util.List; @@ -20,7 +20,7 @@ import java.util.List;
20 * API兼容:设备信息 20 * API兼容:设备信息
21 */ 21 */
22 @SuppressWarnings("unchecked") 22 @SuppressWarnings("unchecked")
23 -@CrossOrigin 23 +
24 @RestController 24 @RestController
25 @RequestMapping(value = "/api/v1/device") 25 @RequestMapping(value = "/api/v1/device")
26 public class ApiDeviceController { 26 public class ApiDeviceController {
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
@@ -26,7 +26,7 @@ import java.text.ParseException; @@ -26,7 +26,7 @@ import java.text.ParseException;
26 * API兼容:实时直播 26 * API兼容:实时直播
27 */ 27 */
28 @SuppressWarnings(value = {"rawtypes", "unchecked"}) 28 @SuppressWarnings(value = {"rawtypes", "unchecked"})
29 -@CrossOrigin 29 +
30 @RestController 30 @RestController
31 @RequestMapping(value = "/api/v1/stream") 31 @RequestMapping(value = "/api/v1/stream")
32 public class ApiStreamController { 32 public class ApiStreamController {
src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java
@@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.storager.dao.dto.User; @@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.storager.dao.dto.User;
5 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.web.bind.annotation.*; 6 import org.springframework.web.bind.annotation.*;
7 7
8 -@CrossOrigin 8 +
9 @RestController 9 @RestController
10 @RequestMapping(value = "/auth") 10 @RequestMapping(value = "/auth")
11 public class AuthController { 11 public class AuthController {
web_src/build/utils.js
@@ -47,8 +47,7 @@ exports.cssLoaders = function (options) { @@ -47,8 +47,7 @@ exports.cssLoaders = function (options) {
47 if (options.extract) { 47 if (options.extract) {
48 return ExtractTextPlugin.extract({ 48 return ExtractTextPlugin.extract({
49 use: loaders, 49 use: loaders,
50 - fallback: 'vue-style-loader',  
51 - publicPath: '../../' 50 + fallback: 'vue-style-loader'
52 }) 51 })
53 } else { 52 } else {
54 return ['vue-style-loader'].concat(loaders) 53 return ['vue-style-loader'].concat(loaders)
web_src/config/index.js
@@ -8,18 +8,18 @@ module.exports = { @@ -8,18 +8,18 @@ module.exports = {
8 dev: { 8 dev: {
9 9
10 // Paths 10 // Paths
11 - assetsSubDirectory: './static',  
12 - assetsPublicPath: './', 11 + assetsSubDirectory: 'static',
  12 + assetsPublicPath: '/',
13 proxyTable: { 13 proxyTable: {
14 '/debug': { 14 '/debug': {
15 - target: 'http://localhost:38080', 15 + target: 'http://localhost:18080',
16 changeOrigin: true, 16 changeOrigin: true,
17 pathRewrite: { 17 pathRewrite: {
18 '^/debug': '/' 18 '^/debug': '/'
19 } 19 }
20 }, 20 },
21 '/static/snap': { 21 '/static/snap': {
22 - target: 'http://localhost:38080', 22 + target: 'http://localhost:18080',
23 changeOrigin: true, 23 changeOrigin: true,
24 // pathRewrite: { 24 // pathRewrite: {
25 // '^/static/snap': '/static/snap' 25 // '^/static/snap': '/static/snap'
@@ -61,7 +61,7 @@ module.exports = { @@ -61,7 +61,7 @@ module.exports = {
61 // Paths 61 // Paths
62 assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'), 62 assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'),
63 assetsSubDirectory: './static', 63 assetsSubDirectory: './static',
64 - assetsPublicPath: './', 64 + assetsPublicPath: '/',
65 65
66 /** 66 /**
67 * Source Maps 67 * Source Maps
web_src/index.html
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script> 13 <script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script>
14 <script type="text/javascript" src="./static/js/liveplayer-lib.min.js"></script> 14 <script type="text/javascript" src="./static/js/liveplayer-lib.min.js"></script>
15 <script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script> 15 <script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script>
16 - <script type="text/javascript" src="./static/js/mapConfig.js"></script> 16 + <script type="text/javascript" src="./static/js/config.js"></script>
17 <div id="app"></div> 17 <div id="app"></div>
18 </body> 18 </body>
19 </html> 19 </html>
web_src/src/components/CloudRecord.vue
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 let that = this; 133 let that = this;
134 this.$axios({ 134 this.$axios({
135 method: 'get', 135 method: 'get',
136 - url:`./record_proxy/${that.mediaServerId}/api/record/list`, 136 + url:`/record_proxy/${that.mediaServerId}/api/record/list`,
137 params: { 137 params: {
138 page: that.currentPage, 138 page: that.currentPage,
139 count: that.count 139 count: that.count
@@ -185,7 +185,7 @@ @@ -185,7 +185,7 @@
185 let that = this; 185 let that = this;
186 this.$axios({ 186 this.$axios({
187 method: 'delete', 187 method: 'delete',
188 - url:`./record_proxy/api/record/delete`, 188 + url:`/record_proxy/api/record/delete`,
189 params: { 189 params: {
190 page: that.currentPage, 190 page: that.currentPage,
191 count: that.count 191 count: that.count
web_src/src/components/CloudRecordDetail.vue
@@ -241,7 +241,7 @@ @@ -241,7 +241,7 @@
241 let that = this; 241 let that = this;
242 that.$axios({ 242 that.$axios({
243 method: 'get', 243 method: 'get',
244 - url:`./record_proxy/${that.mediaServerId}/api/record/file/list`, 244 + url:`/record_proxy/${that.mediaServerId}/api/record/file/list`,
245 params: { 245 params: {
246 app: that.recordFile.app, 246 app: that.recordFile.app,
247 stream: that.recordFile.stream, 247 stream: that.recordFile.stream,
@@ -340,7 +340,7 @@ @@ -340,7 +340,7 @@
340 let that = this; 340 let that = this;
341 this.$axios({ 341 this.$axios({
342 method: 'delete', 342 method: 'delete',
343 - url:`./record_proxy/${that.mediaServerId}/api/record/delete`, 343 + url:`/record_proxy/${that.mediaServerId}/api/record/delete`,
344 params: { 344 params: {
345 page: that.currentPage, 345 page: that.currentPage,
346 count: that.count 346 count: that.count
@@ -359,7 +359,7 @@ @@ -359,7 +359,7 @@
359 that.dateFilesObj = {}; 359 that.dateFilesObj = {};
360 this.$axios({ 360 this.$axios({
361 method: 'get', 361 method: 'get',
362 - url:`./record_proxy/${that.mediaServerId}/api/record/date/list`, 362 + url:`/record_proxy/${that.mediaServerId}/api/record/date/list`,
363 params: { 363 params: {
364 app: that.recordFile.app, 364 app: that.recordFile.app,
365 stream: that.recordFile.stream 365 stream: that.recordFile.stream
@@ -408,7 +408,7 @@ @@ -408,7 +408,7 @@
408 let that = this; 408 let that = this;
409 this.$axios({ 409 this.$axios({
410 method: 'get', 410 method: 'get',
411 - url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, 411 + url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`,
412 params: { 412 params: {
413 app: that.recordFile.app, 413 app: that.recordFile.app,
414 stream: that.recordFile.stream, 414 stream: that.recordFile.stream,
@@ -433,7 +433,7 @@ @@ -433,7 +433,7 @@
433 let that = this; 433 let that = this;
434 this.$axios({ 434 this.$axios({
435 method: 'get', 435 method: 'get',
436 - url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, 436 + url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`,
437 params: { 437 params: {
438 isEnd: isEnd, 438 isEnd: isEnd,
439 } 439 }
web_src/src/components/DeviceList.vue
@@ -152,7 +152,7 @@ export default { @@ -152,7 +152,7 @@ export default {
152 this.getDeviceListLoading = true; 152 this.getDeviceListLoading = true;
153 this.$axios({ 153 this.$axios({
154 method: 'get', 154 method: 'get',
155 - url: `./api/device/query/devices`, 155 + url: `/api/device/query/devices`,
156 params: { 156 params: {
157 page: this.currentPage, 157 page: this.currentPage,
158 count: this.count 158 count: this.count
@@ -182,7 +182,7 @@ export default { @@ -182,7 +182,7 @@ export default {
182 }).then(() => { 182 }).then(() => {
183 this.$axios({ 183 this.$axios({
184 method: 'delete', 184 method: 'delete',
185 - url: `./api/device/query/devices/${row.deviceId}/delete` 185 + url: `/api/device/query/devices/${row.deviceId}/delete`
186 }).then((res) => { 186 }).then((res) => {
187 this.getDeviceList(); 187 this.getDeviceList();
188 }).catch((error) => { 188 }).catch((error) => {
@@ -208,7 +208,7 @@ export default { @@ -208,7 +208,7 @@ export default {
208 let that = this; 208 let that = this;
209 this.$axios({ 209 this.$axios({
210 method: 'get', 210 method: 'get',
211 - url: './api/device/query/devices/' + itemData.deviceId + '/sync' 211 + url: '/api/device/query/devices/' + itemData.deviceId + '/sync'
212 }).then((res) => { 212 }).then((res) => {
213 console.log("刷新设备结果:" + JSON.stringify(res)); 213 console.log("刷新设备结果:" + JSON.stringify(res));
214 if (res.data.code !== 0) { 214 if (res.data.code !== 0) {
@@ -242,7 +242,7 @@ export default { @@ -242,7 +242,7 @@ export default {
242 await this.$axios({ 242 await this.$axios({
243 method: 'get', 243 method: 'get',
244 async: false, 244 async: false,
245 - url: `./api/device/query/${deviceId}/sync_status/`, 245 + url: `/api/device/query/${deviceId}/sync_status/`,
246 }).then((res) => { 246 }).then((res) => {
247 if (res.data.code == 0) { 247 if (res.data.code == 0) {
248 if (res.data.data.errorMsg !== null) { 248 if (res.data.data.errorMsg !== null) {
@@ -261,7 +261,7 @@ export default { @@ -261,7 +261,7 @@ export default {
261 let that = this; 261 let that = this;
262 this.$axios({ 262 this.$axios({
263 method: 'post', 263 method: 'post',
264 - url: './api/device/query/transport/' + row.deviceId + '/' + row.streamMode 264 + url: '/api/device/query/transport/' + row.deviceId + '/' + row.streamMode
265 }).then(function (res) { 265 }).then(function (res) {
266 266
267 }).catch(function (e) { 267 }).catch(function (e) {
web_src/src/components/GBRecordDetail.vue
@@ -197,7 +197,7 @@ @@ -197,7 +197,7 @@
197 this.detailFiles = []; 197 this.detailFiles = [];
198 this.$axios({ 198 this.$axios({
199 method: 'get', 199 method: 'get',
200 - url: './api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime 200 + url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime
201 }).then((res)=>{ 201 }).then((res)=>{
202 this.recordsLoading = false; 202 this.recordsLoading = false;
203 if(res.data.code === 0) { 203 if(res.data.code === 0) {
@@ -249,7 +249,7 @@ @@ -249,7 +249,7 @@
249 } else { 249 } else {
250 this.$axios({ 250 this.$axios({
251 method: 'get', 251 method: 'get',
252 - url: './api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + 252 + url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' +
253 this.endTime 253 this.endTime
254 }).then((res)=> { 254 }).then((res)=> {
255 if (res.data.code === 0) { 255 if (res.data.code === 0) {
@@ -273,7 +273,7 @@ @@ -273,7 +273,7 @@
273 console.log('前端控制:播放'); 273 console.log('前端控制:播放');
274 this.$axios({ 274 this.$axios({
275 method: 'get', 275 method: 'get',
276 - url: './api/playback/resume/' + this.streamId 276 + url: '/api/playback/resume/' + this.streamId
277 }).then((res)=> { 277 }).then((res)=> {
278 this.$refs["recordVideoPlayer"].play(this.videoUrl) 278 this.$refs["recordVideoPlayer"].play(this.videoUrl)
279 }); 279 });
@@ -282,14 +282,14 @@ @@ -282,14 +282,14 @@
282 console.log('前端控制:暂停'); 282 console.log('前端控制:暂停');
283 this.$axios({ 283 this.$axios({
284 method: 'get', 284 method: 'get',
285 - url: './api/playback/pause/' + this.streamId 285 + url: '/api/playback/pause/' + this.streamId
286 }).then(function (res) {}); 286 }).then(function (res) {});
287 }, 287 },
288 gbScale(command){ 288 gbScale(command){
289 console.log('前端控制:倍速 ' + command); 289 console.log('前端控制:倍速 ' + command);
290 this.$axios({ 290 this.$axios({
291 method: 'get', 291 method: 'get',
292 - url: `./api/playback/speed/${this.streamId }/${command}` 292 + url: `/api/playback/speed/${this.streamId }/${command}`
293 }).then(function (res) {}); 293 }).then(function (res) {});
294 }, 294 },
295 downloadRecord: function (row) { 295 downloadRecord: function (row) {
@@ -311,7 +311,7 @@ @@ -311,7 +311,7 @@
311 }else { 311 }else {
312 this.$axios({ 312 this.$axios({
313 method: 'get', 313 method: 'get',
314 - url: './api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' + 314 + url: '/api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
315 row.endTime + '&downloadSpeed=4' 315 row.endTime + '&downloadSpeed=4'
316 }).then( (res)=> { 316 }).then( (res)=> {
317 if (res.data.code === 0) { 317 if (res.data.code === 0) {
@@ -332,7 +332,7 @@ @@ -332,7 +332,7 @@
332 this.videoUrl = ''; 332 this.videoUrl = '';
333 this.$axios({ 333 this.$axios({
334 method: 'get', 334 method: 'get',
335 - url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId 335 + url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId
336 }).then((res)=> { 336 }).then((res)=> {
337 if (callback) callback(res) 337 if (callback) callback(res)
338 }); 338 });
@@ -342,7 +342,7 @@ @@ -342,7 +342,7 @@
342 this.videoUrl = ''; 342 this.videoUrl = '';
343 this.$axios({ 343 this.$axios({
344 method: 'get', 344 method: 'get',
345 - url: './api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId 345 + url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
346 }).then(function (res) { 346 }).then(function (res) {
347 if (callback) callback() 347 if (callback) callback()
348 }); 348 });
web_src/src/components/Login.vue
@@ -81,7 +81,7 @@ export default { @@ -81,7 +81,7 @@ export default {
81 81
82 this.$axios({ 82 this.$axios({
83 method: 'get', 83 method: 'get',
84 - url:"./api/user/login", 84 + url:"/api/user/login",
85 params: loginParam 85 params: loginParam
86 }).then(function (res) { 86 }).then(function (res) {
87 window.clearTimeout(timeoutTask) 87 window.clearTimeout(timeoutTask)
web_src/src/components/ParentPlatformList.vue
@@ -128,7 +128,7 @@ export default { @@ -128,7 +128,7 @@ export default {
128 var that = this; 128 var that = this;
129 that.$axios({ 129 that.$axios({
130 method: 'delete', 130 method: 'delete',
131 - url:`./api/platform/delete/${platform.serverGBId}` 131 + url:`/api/platform/delete/${platform.serverGBId}`
132 }).then(function (res) { 132 }).then(function (res) {
133 if (res.data.code === 0) { 133 if (res.data.code === 0) {
134 that.$message({ 134 that.$message({
@@ -162,7 +162,7 @@ export default { @@ -162,7 +162,7 @@ export default {
162 162
163 this.$axios({ 163 this.$axios({
164 method: 'get', 164 method: 'get',
165 - url:`./api/platform/query/${that.count}/${that.currentPage}` 165 + url:`/api/platform/query/${that.count}/${that.currentPage}`
166 }).then(function (res) { 166 }).then(function (res) {
167 if (res.data.code === 0) { 167 if (res.data.code === 0) {
168 that.total = res.data.data.total; 168 that.total = res.data.data.total;
web_src/src/components/PushVideoList.vue
@@ -171,7 +171,7 @@ export default { @@ -171,7 +171,7 @@ export default {
171 this.getDeviceListLoading = true; 171 this.getDeviceListLoading = true;
172 this.$axios({ 172 this.$axios({
173 method: 'get', 173 method: 'get',
174 - url: `./api/push/list`, 174 + url: `/api/push/list`,
175 params: { 175 params: {
176 page: that.currentPage, 176 page: that.currentPage,
177 count: that.count, 177 count: that.count,
@@ -197,7 +197,7 @@ export default { @@ -197,7 +197,7 @@ export default {
197 this.getListLoading = true; 197 this.getListLoading = true;
198 this.$axios({ 198 this.$axios({
199 method: 'get', 199 method: 'get',
200 - url: './api/push/getPlayUrl', 200 + url: '/api/push/getPlayUrl',
201 params: { 201 params: {
202 app: row.app, 202 app: row.app,
203 stream: row.stream, 203 stream: row.stream,
@@ -223,7 +223,7 @@ export default { @@ -223,7 +223,7 @@ export default {
223 let that = this; 223 let that = this;
224 that.$axios({ 224 that.$axios({
225 method: "post", 225 method: "post",
226 - url: "./api/push/stop", 226 + url: "/api/push/stop",
227 params: { 227 params: {
228 app: row.app, 228 app: row.app,
229 streamId: row.stream 229 streamId: row.stream
@@ -247,7 +247,7 @@ export default { @@ -247,7 +247,7 @@ export default {
247 let that = this; 247 let that = this;
248 that.$axios({ 248 that.$axios({
249 method: "delete", 249 method: "delete",
250 - url: "./api/push/remove_form_gb", 250 + url: "/api/push/remove_form_gb",
251 data: row 251 data: row
252 }).then((res) => { 252 }).then((res) => {
253 if (res.data.code === 0) { 253 if (res.data.code === 0) {
@@ -274,7 +274,7 @@ export default { @@ -274,7 +274,7 @@ export default {
274 let that = this; 274 let that = this;
275 that.$axios({ 275 that.$axios({
276 method: "delete", 276 method: "delete",
277 - url: "./api/push/batchStop", 277 + url: "/api/push/batchStop",
278 data: { 278 data: {
279 gbStreams: this.multipleSelection 279 gbStreams: this.multipleSelection
280 } 280 }
web_src/src/components/StreamProxyList.vue
@@ -167,7 +167,7 @@ @@ -167,7 +167,7 @@
167 let that = this; 167 let that = this;
168 this.$axios({ 168 this.$axios({
169 method: 'get', 169 method: 'get',
170 - url:`./api/proxy/list`, 170 + url:`/api/proxy/list`,
171 params: { 171 params: {
172 page: that.currentPage, 172 page: that.currentPage,
173 count: that.count 173 count: that.count
@@ -190,7 +190,7 @@ @@ -190,7 +190,7 @@
190 addOnvif: function(){ 190 addOnvif: function(){
191 this.$axios({ 191 this.$axios({
192 method: 'get', 192 method: 'get',
193 - url:`./api/onvif/search?timeout=3000`, 193 + url:`/api/onvif/search?timeout=3000`,
194 }).then((res) =>{ 194 }).then((res) =>{
195 if (res.data.code === 0 ){ 195 if (res.data.code === 0 ){
196 if (res.data.data.length > 0) { 196 if (res.data.data.length > 0) {
@@ -218,7 +218,7 @@ @@ -218,7 +218,7 @@
218 let that = this; 218 let that = this;
219 this.$axios({ 219 this.$axios({
220 method: 'get', 220 method: 'get',
221 - url:`./api/push/getPlayUrl`, 221 + url:`/api/push/getPlayUrl`,
222 params: { 222 params: {
223 app: row.app, 223 app: row.app,
224 stream: row.stream, 224 stream: row.stream,
@@ -247,7 +247,7 @@ @@ -247,7 +247,7 @@
247 let that = this; 247 let that = this;
248 that.$axios({ 248 that.$axios({
249 method:"delete", 249 method:"delete",
250 - url:"./api/proxy/del", 250 + url:"/api/proxy/del",
251 params:{ 251 params:{
252 app: row.app, 252 app: row.app,
253 stream: row.stream 253 stream: row.stream
@@ -263,7 +263,7 @@ @@ -263,7 +263,7 @@
263 this.$set(row, 'startBtnLoading', true) 263 this.$set(row, 'startBtnLoading', true)
264 this.$axios({ 264 this.$axios({
265 method: 'get', 265 method: 'get',
266 - url:`./api/proxy/start`, 266 + url:`/api/proxy/start`,
267 params: { 267 params: {
268 app: row.app, 268 app: row.app,
269 stream: row.stream 269 stream: row.stream
@@ -295,7 +295,7 @@ @@ -295,7 +295,7 @@
295 let that = this; 295 let that = this;
296 this.$axios({ 296 this.$axios({
297 method: 'get', 297 method: 'get',
298 - url:`./api/proxy/stop`, 298 + url:`/api/proxy/stop`,
299 params: { 299 params: {
300 app: row.app, 300 app: row.app,
301 stream: row.stream 301 stream: row.stream
web_src/src/components/UserManager.vue
@@ -99,7 +99,7 @@ export default { @@ -99,7 +99,7 @@ export default {
99 this.getUserListLoading = true; 99 this.getUserListLoading = true;
100 this.$axios({ 100 this.$axios({
101 method: 'get', 101 method: 'get',
102 - url: `./api/user/users`, 102 + url: `/api/user/users`,
103 params: { 103 params: {
104 page: that.currentPage, 104 page: that.currentPage,
105 count: that.count 105 count: that.count
@@ -141,7 +141,7 @@ export default { @@ -141,7 +141,7 @@ export default {
141 }).then(() => { 141 }).then(() => {
142 this.$axios({ 142 this.$axios({
143 method: 'delete', 143 method: 'delete',
144 - url: `./api/user/delete?id=${row.id}` 144 + url: `/api/user/delete?id=${row.id}`
145 }).then((res) => { 145 }).then((res) => {
146 this.getUserList(); 146 this.getUserList();
147 }).catch((error) => { 147 }).catch((error) => {
web_src/src/components/channelList.vue
@@ -206,7 +206,7 @@ export default { @@ -206,7 +206,7 @@ export default {
206 if (typeof (this.$route.params.deviceId) == "undefined") return; 206 if (typeof (this.$route.params.deviceId) == "undefined") return;
207 this.$axios({ 207 this.$axios({
208 method: 'get', 208 method: 'get',
209 - url: `./api/device/query/devices/${this.$route.params.deviceId}/channels`, 209 + url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,
210 params: { 210 params: {
211 page: that.currentPage, 211 page: that.currentPage,
212 count: that.count, 212 count: that.count,
@@ -238,7 +238,7 @@ export default { @@ -238,7 +238,7 @@ export default {
238 let that = this; 238 let that = this;
239 this.$axios({ 239 this.$axios({
240 method: 'get', 240 method: 'get',
241 - url: './api/play/start/' + deviceId + '/' + channelId 241 + url: '/api/play/start/' + deviceId + '/' + channelId
242 }).then(function (res) { 242 }).then(function (res) {
243 console.log(res) 243 console.log(res)
244 that.isLoging = false; 244 that.isLoging = false;
@@ -278,7 +278,7 @@ export default { @@ -278,7 +278,7 @@ export default {
278 var that = this; 278 var that = this;
279 this.$axios({ 279 this.$axios({
280 method: 'get', 280 method: 'get',
281 - url: './api/play/stop/' + this.deviceId + "/" + itemData.channelId 281 + url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId
282 }).then(function (res) { 282 }).then(function (res) {
283 that.initData(); 283 that.initData();
284 }).catch(function (error) { 284 }).catch(function (error) {
@@ -334,7 +334,7 @@ export default { @@ -334,7 +334,7 @@ export default {
334 if (!this.showTree) { 334 if (!this.showTree) {
335 this.$axios({ 335 this.$axios({
336 method: 'get', 336 method: 'get',
337 - url: `./api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, 337 + url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`,
338 params: { 338 params: {
339 page: this.currentPage, 339 page: this.currentPage,
340 count: this.count, 340 count: this.count,
@@ -358,7 +358,7 @@ export default { @@ -358,7 +358,7 @@ export default {
358 }else { 358 }else {
359 this.$axios({ 359 this.$axios({
360 method: 'get', 360 method: 'get',
361 - url: `./api/device/query/tree/channel/${this.deviceId}`, 361 + url: `/api/device/query/tree/channel/${this.deviceId}`,
362 params: { 362 params: {
363 parentId: this.parentChannelId, 363 parentId: this.parentChannelId,
364 page: this.currentPage, 364 page: this.currentPage,
@@ -387,7 +387,7 @@ export default { @@ -387,7 +387,7 @@ export default {
387 updateChannel: function (row) { 387 updateChannel: function (row) {
388 this.$axios({ 388 this.$axios({
389 method: 'post', 389 method: 'post',
390 - url: `./api/device/query/channel/update/${this.deviceId}`, 390 + url: `/api/device/query/channel/update/${this.deviceId}`,
391 params: row 391 params: row
392 }).then(function (res) { 392 }).then(function (res) {
393 console.log(JSON.stringify(res)); 393 console.log(JSON.stringify(res));
web_src/src/components/console.vue
@@ -114,7 +114,7 @@ export default { @@ -114,7 +114,7 @@ export default {
114 getSystemInfo: function (){ 114 getSystemInfo: function (){
115 this.$axios({ 115 this.$axios({
116 method: 'get', 116 method: 'get',
117 - url: `./api/server/system/info`, 117 + url: `/api/server/system/info`,
118 }).then( (res)=> { 118 }).then( (res)=> {
119 if (res.data.code === 0) { 119 if (res.data.code === 0) {
120 this.$refs.consoleCPU.setData(res.data.data.cpu) 120 this.$refs.consoleCPU.setData(res.data.data.cpu)
@@ -128,7 +128,7 @@ export default { @@ -128,7 +128,7 @@ export default {
128 getLoad: function (){ 128 getLoad: function (){
129 this.$axios({ 129 this.$axios({
130 method: 'get', 130 method: 'get',
131 - url: `./api/server/media_server/load`, 131 + url: `/api/server/media_server/load`,
132 }).then( (res)=> { 132 }).then( (res)=> {
133 if (res.data.code === 0) { 133 if (res.data.code === 0) {
134 this.$refs.consoleNodeLoad.setData(res.data.data) 134 this.$refs.consoleNodeLoad.setData(res.data.data)
@@ -139,7 +139,7 @@ export default { @@ -139,7 +139,7 @@ export default {
139 getResourceInfo: function (){ 139 getResourceInfo: function (){
140 this.$axios({ 140 this.$axios({
141 method: 'get', 141 method: 'get',
142 - url: `./api/server/resource/info`, 142 + url: `/api/server/resource/info`,
143 }).then( (res)=> { 143 }).then( (res)=> {
144 if (res.data.code === 0) { 144 if (res.data.code === 0) {
145 this.$refs.consoleResource.setData(res.data.data) 145 this.$refs.consoleResource.setData(res.data.data)
@@ -151,7 +151,7 @@ export default { @@ -151,7 +151,7 @@ export default {
151 151
152 this.$axios({ 152 this.$axios({
153 method: 'get', 153 method: 'get',
154 - url: `./api/server/system/configInfo`, 154 + url: `/api/server/system/configInfo`,
155 }).then( (res)=> { 155 }).then( (res)=> {
156 console.log(res) 156 console.log(res)
157 if (res.data.code === 0) { 157 if (res.data.code === 0) {
web_src/src/components/dialog/MediaServerEdit.vue
@@ -335,7 +335,7 @@ export default { @@ -335,7 +335,7 @@ export default {
335 var that = this; 335 var that = this;
336 await that.$axios({ 336 await that.$axios({
337 method: 'get', 337 method: 'get',
338 - url:`./api/platform/exit/${deviceGbId}` 338 + url:`/api/platform/exit/${deviceGbId}`
339 }).then(function (res) { 339 }).then(function (res) {
340 result = res.data; 340 result = res.data;
341 }).catch(function (error) { 341 }).catch(function (error) {
web_src/src/components/dialog/StreamProxyEdit.vue
@@ -195,7 +195,7 @@ export default { @@ -195,7 +195,7 @@ export default {
195 let that = this; 195 let that = this;
196 this.$axios({ 196 this.$axios({
197 method: 'get', 197 method: 'get',
198 - url:`./api/platform/query/10000/1` 198 + url:`/api/platform/query/10000/1`
199 }).then(function (res) { 199 }).then(function (res) {
200 that.platformList = res.data.data.list; 200 that.platformList = res.data.data.list;
201 }).catch(function (error) { 201 }).catch(function (error) {
@@ -212,7 +212,7 @@ export default { @@ -212,7 +212,7 @@ export default {
212 if (that.proxyParam.mediaServerId !== "auto"){ 212 if (that.proxyParam.mediaServerId !== "auto"){
213 that.$axios({ 213 that.$axios({
214 method: 'get', 214 method: 'get',
215 - url:`./api/proxy/ffmpeg_cmd/list`, 215 + url:`/api/proxy/ffmpeg_cmd/list`,
216 params: { 216 params: {
217 mediaServerId: that.proxyParam.mediaServerId 217 mediaServerId: that.proxyParam.mediaServerId
218 } 218 }
@@ -230,7 +230,7 @@ export default { @@ -230,7 +230,7 @@ export default {
230 this.noneReaderHandler(); 230 this.noneReaderHandler();
231 this.$axios({ 231 this.$axios({
232 method: 'post', 232 method: 'post',
233 - url:`./api/proxy/save`, 233 + url:`/api/proxy/save`,
234 data: this.proxyParam 234 data: this.proxyParam
235 }).then((res)=> { 235 }).then((res)=> {
236 this.dialogLoading = false; 236 this.dialogLoading = false;
@@ -261,7 +261,7 @@ export default { @@ -261,7 +261,7 @@ export default {
261 var that = this; 261 var that = this;
262 await that.$axios({ 262 await that.$axios({
263 method: 'get', 263 method: 'get',
264 - url:`./api/platform/exit/${deviceGbId}` 264 + url:`/api/platform/exit/${deviceGbId}`
265 }).then(function (res) { 265 }).then(function (res) {
266 result = res.data; 266 result = res.data;
267 }).catch(function (error) { 267 }).catch(function (error) {
web_src/src/components/dialog/SyncChannelProgress.vue
@@ -55,7 +55,7 @@ export default { @@ -55,7 +55,7 @@ export default {
55 getProgress(){ 55 getProgress(){
56 this.$axios({ 56 this.$axios({
57 method: 'get', 57 method: 'get',
58 - url:`./api/device/query/${this.deviceId}/sync_status/`, 58 + url:`/api/device/query/${this.deviceId}/sync_status/`,
59 }).then((res) => { 59 }).then((res) => {
60 if (res.data.code === 0) { 60 if (res.data.code === 0) {
61 if (!this.syncFlag) { 61 if (!this.syncFlag) {
web_src/src/components/dialog/addUser.vue
@@ -100,7 +100,7 @@ export default { @@ -100,7 +100,7 @@ export default {
100 onSubmit: function () { 100 onSubmit: function () {
101 this.$axios({ 101 this.$axios({
102 method: 'post', 102 method: 'post',
103 - url: "./api/user/add", 103 + url: "/api/user/add",
104 params: { 104 params: {
105 username: this.username, 105 username: this.username,
106 password: this.password, 106 password: this.password,
@@ -139,7 +139,7 @@ export default { @@ -139,7 +139,7 @@ export default {
139 139
140 this.$axios({ 140 this.$axios({
141 method: 'get', 141 method: 'get',
142 - url: "./api/role/all" 142 + url: "/api/role/all"
143 }).then((res) => { 143 }).then((res) => {
144 this.loading = true; 144 this.loading = true;
145 if (res.data.code === 0) { 145 if (res.data.code === 0) {
web_src/src/components/dialog/catalogEdit.vue
@@ -116,7 +116,7 @@ export default { @@ -116,7 +116,7 @@ export default {
116 console.log(this.form); 116 console.log(this.form);
117 this.$axios({ 117 this.$axios({
118 method:"post", 118 method:"post",
119 - url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, 119 + url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
120 data: this.form 120 data: this.form
121 }).then((res)=> { 121 }).then((res)=> {
122 if (res.data.code === 0) { 122 if (res.data.code === 0) {
web_src/src/components/dialog/changePassword.vue
@@ -90,7 +90,7 @@ export default { @@ -90,7 +90,7 @@ export default {
90 onSubmit: function () { 90 onSubmit: function () {
91 this.$axios({ 91 this.$axios({
92 method: 'post', 92 method: 'post',
93 - url:"./api/user/changePassword", 93 + url:"/api/user/changePassword",
94 params: { 94 params: {
95 oldPassword: crypto.createHash('md5').update(this.oldPassword, "utf8").digest('hex'), 95 oldPassword: crypto.createHash('md5').update(this.oldPassword, "utf8").digest('hex'),
96 password: this.newPassword 96 password: this.newPassword
web_src/src/components/dialog/changePasswordForAdmin.vue
@@ -85,7 +85,7 @@ export default { @@ -85,7 +85,7 @@ export default {
85 onSubmit: function () { 85 onSubmit: function () {
86 this.$axios({ 86 this.$axios({
87 method: 'post', 87 method: 'post',
88 - url:"./api/user/changePasswordForAdmin", 88 + url:"/api/user/changePasswordForAdmin",
89 params: { 89 params: {
90 password: this.newPassword, 90 password: this.newPassword,
91 userId: this.form.id, 91 userId: this.form.id,
web_src/src/components/dialog/changePushKey.vue
@@ -65,7 +65,7 @@ export default { @@ -65,7 +65,7 @@ export default {
65 onSubmit: function () { 65 onSubmit: function () {
66 this.$axios({ 66 this.$axios({
67 method: 'post', 67 method: 'post',
68 - url:"./api/user/changePushKey", 68 + url:"/api/user/changePushKey",
69 params: { 69 params: {
70 pushKey: this.newPushKey, 70 pushKey: this.newPushKey,
71 userId: this.form.id, 71 userId: this.form.id,
web_src/src/components/dialog/channelMapInfobox.vue
@@ -44,7 +44,7 @@ export default { @@ -44,7 +44,7 @@ export default {
44 let that = this; 44 let that = this;
45 this.$axios({ 45 this.$axios({
46 method: 'get', 46 method: 'get',
47 - url: './api/play/start/' + deviceId + '/' + channelId 47 + url: '/api/play/start/' + deviceId + '/' + channelId
48 }).then(function (res) { 48 }).then(function (res) {
49 that.isLoging = false; 49 that.isLoging = false;
50 if (res.data.code === 0) { 50 if (res.data.code === 0) {
web_src/src/components/dialog/chooseChannel.vue
@@ -98,7 +98,7 @@ export default { @@ -98,7 +98,7 @@ export default {
98 98
99 this.$axios({ 99 this.$axios({
100 method:"post", 100 method:"post",
101 - url:"./api/platform/update_channel_for_gb", 101 + url:"/api/platform/update_channel_for_gb",
102 data:{ 102 data:{
103 platformId: that.platformId, 103 platformId: that.platformId,
104 channelReduces: that.chooseData 104 channelReduces: that.chooseData
web_src/src/components/dialog/chooseChannelForCatalog.vue
@@ -82,7 +82,7 @@ export default { @@ -82,7 +82,7 @@ export default {
82 let that = this; 82 let that = this;
83 this.$axios({ 83 this.$axios({
84 method:"get", 84 method:"get",
85 - url:`./api/platform/catalog`, 85 + url:`/api/platform/catalog`,
86 params: { 86 params: {
87 platformId: that.platformId, 87 platformId: that.platformId,
88 parentId: parentId 88 parentId: parentId
@@ -134,7 +134,7 @@ export default { @@ -134,7 +134,7 @@ export default {
134 removeCatalog: function (id, node){ 134 removeCatalog: function (id, node){
135 this.$axios({ 135 this.$axios({
136 method:"delete", 136 method:"delete",
137 - url:`./api/platform/catalog/del`, 137 + url:`/api/platform/catalog/del`,
138 params: { 138 params: {
139 id: id, 139 id: id,
140 platformId: this.platformId, 140 platformId: this.platformId,
@@ -156,7 +156,7 @@ export default { @@ -156,7 +156,7 @@ export default {
156 setDefaultCatalog: function (id){ 156 setDefaultCatalog: function (id){
157 this.$axios({ 157 this.$axios({
158 method:"post", 158 method:"post",
159 - url:`./api/platform/catalog/default/update`, 159 + url:`/api/platform/catalog/default/update`,
160 params: { 160 params: {
161 platformId: this.platformId, 161 platformId: this.platformId,
162 catalogId: id, 162 catalogId: id,
@@ -201,7 +201,7 @@ export default { @@ -201,7 +201,7 @@ export default {
201 onClick: () => { 201 onClick: () => {
202 this.$axios({ 202 this.$axios({
203 method:"delete", 203 method:"delete",
204 - url:"./api/platform/catalog/relation/del", 204 + url:"/api/platform/catalog/relation/del",
205 data: data 205 data: data
206 }).then((res)=>{ 206 }).then((res)=>{
207 console.log("移除成功") 207 console.log("移除成功")
web_src/src/components/dialog/chooseChannelForGb.vue
@@ -121,7 +121,7 @@ export default { @@ -121,7 +121,7 @@ export default {
121 this.getCatalogFromUser((catalogId)=> { 121 this.getCatalogFromUser((catalogId)=> {
122 this.$axios({ 122 this.$axios({
123 method:"post", 123 method:"post",
124 - url:"./api/platform/update_channel_for_gb", 124 + url:"/api/platform/update_channel_for_gb",
125 data:{ 125 data:{
126 platformId: this.platformId, 126 platformId: this.platformId,
127 all: all, 127 all: all,
@@ -149,7 +149,7 @@ export default { @@ -149,7 +149,7 @@ export default {
149 149
150 this.$axios({ 150 this.$axios({
151 method:"delete", 151 method:"delete",
152 - url:"./api/platform/del_channel_for_gb", 152 + url:"/api/platform/del_channel_for_gb",
153 data:{ 153 data:{
154 platformId: this.platformId, 154 platformId: this.platformId,
155 all: all, 155 all: all,
@@ -248,7 +248,7 @@ export default { @@ -248,7 +248,7 @@ export default {
248 248
249 this.$axios({ 249 this.$axios({
250 method:"get", 250 method:"get",
251 - url:`./api/platform/channel_list`, 251 + url:`/api/platform/channel_list`,
252 params: { 252 params: {
253 page: that.currentPage, 253 page: that.currentPage,
254 count: that.count, 254 count: that.count,
@@ -290,7 +290,7 @@ export default { @@ -290,7 +290,7 @@ export default {
290 }).then(() => { 290 }).then(() => {
291 this.$axios({ 291 this.$axios({
292 method:"delete", 292 method:"delete",
293 - url:"./api/platform/del_channel_for_gb", 293 + url:"/api/platform/del_channel_for_gb",
294 data:{ 294 data:{
295 platformId: this.platformId, 295 platformId: this.platformId,
296 channelReduces: this.multipleSelection 296 channelReduces: this.multipleSelection
@@ -310,7 +310,7 @@ export default { @@ -310,7 +310,7 @@ export default {
310 310
311 this.$axios({ 311 this.$axios({
312 method: "post", 312 method: "post",
313 - url: "./api/platform/update_channel_for_gb", 313 + url: "/api/platform/update_channel_for_gb",
314 data: { 314 data: {
315 platformId: this.platformId, 315 platformId: this.platformId,
316 channelReduces: this.multipleSelection, 316 channelReduces: this.multipleSelection,
web_src/src/components/dialog/chooseChannelForStream.vue
@@ -134,7 +134,7 @@ export default { @@ -134,7 +134,7 @@ export default {
134 this.getCatalogFromUser((catalogId)=>{ 134 this.getCatalogFromUser((catalogId)=>{
135 this.$axios({ 135 this.$axios({
136 method:"post", 136 method:"post",
137 - url:"./api/gbStream/add", 137 + url:"/api/gbStream/add",
138 data:{ 138 data:{
139 platformId: this.platformId, 139 platformId: this.platformId,
140 catalogId: catalogId, 140 catalogId: catalogId,
@@ -163,7 +163,7 @@ export default { @@ -163,7 +163,7 @@ export default {
163 163
164 this.$axios({ 164 this.$axios({
165 method:"delete", 165 method:"delete",
166 - url:"./api/gbStream/del", 166 + url:"/api/gbStream/del",
167 data:{ 167 data:{
168 platformId: this.platformId, 168 platformId: this.platformId,
169 all: all, 169 all: all,
@@ -186,7 +186,7 @@ export default { @@ -186,7 +186,7 @@ export default {
186 186
187 this.$axios({ 187 this.$axios({
188 method: 'get', 188 method: 'get',
189 - url:`./api/gbStream/list`, 189 + url:`/api/gbStream/list`,
190 params: { 190 params: {
191 page: that.currentPage, 191 page: that.currentPage,
192 count: that.count, 192 count: that.count,
@@ -222,7 +222,7 @@ export default { @@ -222,7 +222,7 @@ export default {
222 }).then(() => { 222 }).then(() => {
223 this.$axios({ 223 this.$axios({
224 method:"delete", 224 method:"delete",
225 - url:"./api/gbStream/del", 225 + url:"/api/gbStream/del",
226 data:{ 226 data:{
227 platformId: this.platformId, 227 platformId: this.platformId,
228 gbStreams: this.multipleSelection, 228 gbStreams: this.multipleSelection,
@@ -242,7 +242,7 @@ export default { @@ -242,7 +242,7 @@ export default {
242 this.getCatalogFromUser((catalogId)=>{ 242 this.getCatalogFromUser((catalogId)=>{
243 this.$axios({ 243 this.$axios({
244 method:"post", 244 method:"post",
245 - url:"./api/gbStream/add", 245 + url:"/api/gbStream/add",
246 data:{ 246 data:{
247 platformId: this.platformId, 247 platformId: this.platformId,
248 catalogId: catalogId, 248 catalogId: catalogId,
web_src/src/components/dialog/deviceEdit.vue
@@ -131,7 +131,7 @@ export default { @@ -131,7 +131,7 @@ export default {
131 this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0 131 this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
132 this.$axios({ 132 this.$axios({
133 method: 'post', 133 method: 'post',
134 - url:`./api/device/query/device/${this.isEdit?'update':'add'}/`, 134 + url:`/api/device/query/device/${this.isEdit?'update':'add'}/`,
135 params: this.form 135 params: this.form
136 }).then((res) => { 136 }).then((res) => {
137 console.log(res.data) 137 console.log(res.data)
web_src/src/components/dialog/devicePlayer.vue
@@ -320,7 +320,7 @@ export default { @@ -320,7 +320,7 @@ export default {
320 if (tab.name === "codec") { 320 if (tab.name === "codec") {
321 this.$axios({ 321 this.$axios({
322 method: 'get', 322 method: 'get',
323 - url: './zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId 323 + url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId
324 }).then(function (res) { 324 }).then(function (res) {
325 that.tracksLoading = false; 325 that.tracksLoading = false;
326 if (res.data.code == 0 && res.data.tracks) { 326 if (res.data.code == 0 && res.data.tracks) {
@@ -397,7 +397,7 @@ export default { @@ -397,7 +397,7 @@ export default {
397 this.$refs[this.activePlayer].pause() 397 this.$refs[this.activePlayer].pause()
398 that.$axios({ 398 that.$axios({
399 method: 'post', 399 method: 'post',
400 - url: './api/play/convert/' + that.streamId 400 + url: '/api/play/convert/' + that.streamId
401 }).then(function (res) { 401 }).then(function (res) {
402 if (res.data.code === 0) { 402 if (res.data.code === 0) {
403 that.convertKey = res.data.key; 403 that.convertKey = res.data.key;
@@ -434,7 +434,7 @@ export default { @@ -434,7 +434,7 @@ export default {
434 that.$refs.videoPlayer.pause() 434 that.$refs.videoPlayer.pause()
435 this.$axios({ 435 this.$axios({
436 method: 'post', 436 method: 'post',
437 - url: './api/play/convertStop/' + this.convertKey 437 + url: '/api/play/convertStop/' + this.convertKey
438 }).then(function (res) { 438 }).then(function (res) {
439 if (res.data.code == 0) { 439 if (res.data.code == 0) {
440 console.log(res.data.msg) 440 console.log(res.data.msg)
@@ -494,7 +494,7 @@ export default { @@ -494,7 +494,7 @@ export default {
494 let that = this; 494 let that = this;
495 this.$axios({ 495 this.$axios({
496 method: 'post', 496 method: 'post',
497 - url: './api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed 497 + url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed
498 }).then(function (res) {}); 498 }).then(function (res) {});
499 }, 499 },
500 //////////////////////播放器事件处理////////////////////////// 500 //////////////////////播放器事件处理//////////////////////////
@@ -506,7 +506,7 @@ export default { @@ -506,7 +506,7 @@ export default {
506 let that = this; 506 let that = this;
507 this.$axios({ 507 this.$axios({
508 method: 'post', 508 method: 'post',
509 - url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0' 509 + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0'
510 }).then(function (res) {}); 510 }).then(function (res) {});
511 }, 511 },
512 setSpeedOrTime: function (cmdCode, groupNum, parameter) { 512 setSpeedOrTime: function (cmdCode, groupNum, parameter) {
@@ -516,7 +516,7 @@ export default { @@ -516,7 +516,7 @@ export default {
516 console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); 516 console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16));
517 this.$axios({ 517 this.$axios({
518 method: 'post', 518 method: 'post',
519 - url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2 519 + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2
520 }).then(function (res) {}); 520 }).then(function (res) {});
521 }, 521 },
522 setCommand: function (cmdCode, groupNum, parameter) { 522 setCommand: function (cmdCode, groupNum, parameter) {
@@ -524,7 +524,7 @@ export default { @@ -524,7 +524,7 @@ export default {
524 console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); 524 console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0');
525 this.$axios({ 525 this.$axios({
526 method: 'post', 526 method: 'post',
527 - url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0' 527 + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0'
528 }).then(function (res) {}); 528 }).then(function (res) {});
529 }, 529 },
530 copyUrl: function (dropdownItem){ 530 copyUrl: function (dropdownItem){
web_src/src/components/dialog/getCatalog.vue
@@ -89,7 +89,7 @@ export default { @@ -89,7 +89,7 @@ export default {
89 let that = this; 89 let that = this;
90 this.$axios({ 90 this.$axios({
91 method:"get", 91 method:"get",
92 - url:`./api/platform/catalog`, 92 + url:`/api/platform/catalog`,
93 params: { 93 params: {
94 platformId: that.platformId, 94 platformId: that.platformId,
95 parentId: parentId 95 parentId: parentId
@@ -111,7 +111,7 @@ export default { @@ -111,7 +111,7 @@ export default {
111 if (node.level === 0) { 111 if (node.level === 0) {
112 this.$axios({ 112 this.$axios({
113 method:"get", 113 method:"get",
114 - url:`./api/platform/info/` + this.platformId, 114 + url:`/api/platform/info/` + this.platformId,
115 }) 115 })
116 .then((res)=> { 116 .then((res)=> {
117 if (res.data.code === 0) { 117 if (res.data.code === 0) {
web_src/src/components/dialog/importChannel.vue
@@ -60,7 +60,7 @@ export default { @@ -60,7 +60,7 @@ export default {
60 console.log(this.form); 60 console.log(this.form);
61 this.$axios({ 61 this.$axios({
62 method:"post", 62 method:"post",
63 - url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, 63 + url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
64 data: this.form 64 data: this.form
65 }) 65 })
66 .then((res)=> { 66 .then((res)=> {
web_src/src/components/dialog/onvifEdit.vue
@@ -81,7 +81,7 @@ export default { @@ -81,7 +81,7 @@ export default {
81 console.log(this.form); 81 console.log(this.form);
82 this.$axios({ 82 this.$axios({
83 method: 'get', 83 method: 'get',
84 - url:`./api/onvif/rtsp`, 84 + url:`/api/onvif/rtsp`,
85 params: { 85 params: {
86 hostname: this.form.hostName, 86 hostname: this.form.hostName,
87 timeout: 3000, 87 timeout: 3000,
web_src/src/components/dialog/platformEdit.vue
@@ -138,7 +138,7 @@ export default { @@ -138,7 +138,7 @@ export default {
138 showDialog: false, 138 showDialog: false,
139 isLoging: false, 139 isLoging: false,
140 onSubmit_text: "立即创建", 140 onSubmit_text: "立即创建",
141 - saveUrl: "./api/platform/save", 141 + saveUrl: "/api/platform/save",
142 142
143 platform: { 143 platform: {
144 id: null, 144 id: null,
@@ -192,7 +192,7 @@ export default { @@ -192,7 +192,7 @@ export default {
192 this.saveUrl = "/api/platform/add"; 192 this.saveUrl = "/api/platform/add";
193 this.$axios({ 193 this.$axios({
194 method: 'get', 194 method: 'get',
195 - url:`./api/platform/server_config` 195 + url:`/api/platform/server_config`
196 }).then(function (res) { 196 }).then(function (res) {
197 console.log(res); 197 console.log(res);
198 if (res.data.code === 0) { 198 if (res.data.code === 0) {
@@ -315,7 +315,7 @@ export default { @@ -315,7 +315,7 @@ export default {
315 var that = this; 315 var that = this;
316 await that.$axios({ 316 await that.$axios({
317 method: 'get', 317 method: 'get',
318 - url:`./api/platform/exit/${deviceGbId}`}) 318 + url:`/api/platform/exit/${deviceGbId}`})
319 .then(function (res) { 319 .then(function (res) {
320 if (res.data.code === 0) { 320 if (res.data.code === 0) {
321 result = res.data.data; 321 result = res.data.data;
web_src/src/components/dialog/pushStreamEdit.vue
@@ -109,7 +109,7 @@ export default { @@ -109,7 +109,7 @@ export default {
109 if (this.edit) { 109 if (this.edit) {
110 this.$axios({ 110 this.$axios({
111 method:"post", 111 method:"post",
112 - url:`./api/push/save_to_gb`, 112 + url:`/api/push/save_to_gb`,
113 data: this.proxyParam 113 data: this.proxyParam
114 }).then( (res) => { 114 }).then( (res) => {
115 if (res.data.code === 0) { 115 if (res.data.code === 0) {
@@ -129,7 +129,7 @@ export default { @@ -129,7 +129,7 @@ export default {
129 }else { 129 }else {
130 this.$axios({ 130 this.$axios({
131 method:"post", 131 method:"post",
132 - url:`./api/push/add`, 132 + url:`/api/push/add`,
133 data: this.proxyParam 133 data: this.proxyParam
134 }).then( (res) => { 134 }).then( (res) => {
135 if (res.data.code === 0) { 135 if (res.data.code === 0) {
@@ -159,7 +159,7 @@ export default { @@ -159,7 +159,7 @@ export default {
159 var that = this; 159 var that = this;
160 await that.$axios({ 160 await that.$axios({
161 method:"get", 161 method:"get",
162 - url:`./api/platform/exit/${deviceGbId}` 162 + url:`/api/platform/exit/${deviceGbId}`
163 }).then(function (res) { 163 }).then(function (res) {
164 result = res.data; 164 result = res.data;
165 }).catch(function (error) { 165 }).catch(function (error) {
web_src/src/components/dialog/queryTrace.vue
@@ -72,7 +72,7 @@ export default { @@ -72,7 +72,7 @@ export default {
72 onSubmit: function () { 72 onSubmit: function () {
73 console.log("onSubmit"); 73 console.log("onSubmit");
74 this.isLoging = true; 74 this.isLoging = true;
75 - let url = `./api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`; 75 + let url = `/api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`;
76 if (this.channel.channelId) { 76 if (this.channel.channelId) {
77 url+="&channelId=${this.channel.channelId}" 77 url+="&channelId=${this.channel.channelId}"
78 } 78 }
web_src/src/components/dialog/recordDownload.vue
@@ -71,7 +71,7 @@ export default { @@ -71,7 +71,7 @@ export default {
71 getProgress: function (callback){ 71 getProgress: function (callback){
72 this.$axios({ 72 this.$axios({
73 method: 'get', 73 method: 'get',
74 - url: `./api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}` 74 + url: `/api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}`
75 }).then((res)=> { 75 }).then((res)=> {
76 console.log(res) 76 console.log(res)
77 if (res.data.code === 0) { 77 if (res.data.code === 0) {
@@ -124,7 +124,7 @@ export default { @@ -124,7 +124,7 @@ export default {
124 stopDownloadRecord: function (callback) { 124 stopDownloadRecord: function (callback) {
125 this.$axios({ 125 this.$axios({
126 method: 'get', 126 method: 'get',
127 - url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream 127 + url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream
128 }).then((res)=> { 128 }).then((res)=> {
129 if (callback) callback(res) 129 if (callback) callback(res)
130 }); 130 });
@@ -132,7 +132,7 @@ export default { @@ -132,7 +132,7 @@ export default {
132 getFileDownload: function (){ 132 getFileDownload: function (){
133 this.$axios({ 133 this.$axios({
134 method: 'get', 134 method: 'get',
135 - url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/add`, 135 + url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/add`,
136 params: { 136 params: {
137 app: this.app, 137 app: this.app,
138 stream: this.stream, 138 stream: this.stream,
@@ -164,7 +164,7 @@ export default { @@ -164,7 +164,7 @@ export default {
164 getProgressForFile: function (callback){ 164 getProgressForFile: function (callback){
165 this.$axios({ 165 this.$axios({
166 method: 'get', 166 method: 'get',
167 - url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/list`, 167 + url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/list`,
168 params: { 168 params: {
169 app: this.app, 169 app: this.app,
170 stream: this.stream, 170 stream: this.stream,
web_src/src/components/live.vue
@@ -135,7 +135,7 @@ export default { @@ -135,7 +135,7 @@ export default {
135 this.loading = true 135 this.loading = true
136 this.$axios({ 136 this.$axios({
137 method: 'get', 137 method: 'get',
138 - url: './api/play/start/' + deviceId + '/' + channelId 138 + url: '/api/play/start/' + deviceId + '/' + channelId
139 }).then(function (res) { 139 }).then(function (res) {
140 if (res.data.code === 0 && res.data.data) { 140 if (res.data.code === 0 && res.data.data) {
141 let videoUrl; 141 let videoUrl;
web_src/src/components/map.vue
@@ -298,7 +298,7 @@ export default { @@ -298,7 +298,7 @@ export default {
298 let that = this; 298 let that = this;
299 this.$axios({ 299 this.$axios({
300 method: 'get', 300 method: 'get',
301 - url: './api/play/start/' + deviceId + '/' + channelId 301 + url: '/api/play/start/' + deviceId + '/' + channelId
302 }).then(function (res) { 302 }).then(function (res) {
303 that.isLoging = false; 303 that.isLoging = false;
304 if (res.data.code === 0) { 304 if (res.data.code === 0) {
web_src/src/components/service/DeviceService.js
@@ -9,7 +9,7 @@ class DeviceService{ @@ -9,7 +9,7 @@ class DeviceService{
9 getDeviceList(currentPage, count, callback, errorCallback){ 9 getDeviceList(currentPage, count, callback, errorCallback){
10 this.$axios({ 10 this.$axios({
11 method: 'get', 11 method: 'get',
12 - url:`./api/device/query/devices`, 12 + url:`/api/device/query/devices`,
13 params: { 13 params: {
14 page: currentPage, 14 page: currentPage,
15 count: count 15 count: count
@@ -25,7 +25,7 @@ class DeviceService{ @@ -25,7 +25,7 @@ class DeviceService{
25 getDevice(deviceId, callback, errorCallback){ 25 getDevice(deviceId, callback, errorCallback){
26 this.$axios({ 26 this.$axios({
27 method: 'get', 27 method: 'get',
28 - url:`./api/device/query/devices/${deviceId}`, 28 + url:`/api/device/query/devices/${deviceId}`,
29 }).then((res) => { 29 }).then((res) => {
30 if (typeof (callback) == "function") callback(res.data) 30 if (typeof (callback) == "function") callback(res.data)
31 }).catch((error) => { 31 }).catch((error) => {
@@ -82,7 +82,7 @@ class DeviceService{ @@ -82,7 +82,7 @@ class DeviceService{
82 getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) { 82 getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) {
83 this.$axios({ 83 this.$axios({
84 method: 'get', 84 method: 'get',
85 - url: `./api/device/query/devices/${deviceId}/channels`, 85 + url: `/api/device/query/devices/${deviceId}/channels`,
86 params:{ 86 params:{
87 page: currentPage, 87 page: currentPage,
88 count: count, 88 count: count,
@@ -121,7 +121,7 @@ class DeviceService{ @@ -121,7 +121,7 @@ class DeviceService{
121 getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) { 121 getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) {
122 this.$axios({ 122 this.$axios({
123 method: 'get', 123 method: 'get',
124 - url: `./api/device/query/sub_channels/${deviceId}/${channelId}/channels`, 124 + url: `/api/device/query/sub_channels/${deviceId}/${channelId}/channels`,
125 params:{ 125 params:{
126 page: currentPage, 126 page: currentPage,
127 count: count, 127 count: count,
@@ -161,7 +161,7 @@ class DeviceService{ @@ -161,7 +161,7 @@ class DeviceService{
161 } 161 }
162 this.$axios({ 162 this.$axios({
163 method: 'get', 163 method: 'get',
164 - url: `./api/device/query/tree/${deviceId}`, 164 + url: `/api/device/query/tree/${deviceId}`,
165 params:{ 165 params:{
166 page: currentPage, 166 page: currentPage,
167 count: count, 167 count: count,
web_src/src/components/service/MediaServer.js
@@ -9,7 +9,7 @@ class MediaServer{ @@ -9,7 +9,7 @@ class MediaServer{
9 getOnlineMediaServerList(callback){ 9 getOnlineMediaServerList(callback){
10 this.$axios({ 10 this.$axios({
11 method: 'get', 11 method: 'get',
12 - url:`./api/server/media_server/online/list`, 12 + url:`/api/server/media_server/online/list`,
13 }).then((res) => { 13 }).then((res) => {
14 if (typeof (callback) == "function") callback(res.data) 14 if (typeof (callback) == "function") callback(res.data)
15 }).catch((error) => { 15 }).catch((error) => {
@@ -19,7 +19,7 @@ class MediaServer{ @@ -19,7 +19,7 @@ class MediaServer{
19 getMediaServerList(callback){ 19 getMediaServerList(callback){
20 this.$axios({ 20 this.$axios({
21 method: 'get', 21 method: 'get',
22 - url:`./api/server/media_server/list`, 22 + url:`/api/server/media_server/list`,
23 }).then(function (res) { 23 }).then(function (res) {
24 if (typeof (callback) == "function") callback(res.data) 24 if (typeof (callback) == "function") callback(res.data)
25 }).catch(function (error) { 25 }).catch(function (error) {
@@ -30,7 +30,7 @@ class MediaServer{ @@ -30,7 +30,7 @@ class MediaServer{
30 getMediaServer(id, callback){ 30 getMediaServer(id, callback){
31 this.$axios({ 31 this.$axios({
32 method: 'get', 32 method: 'get',
33 - url:`./api/server/media_server/one/` + id, 33 + url:`/api/server/media_server/one/` + id,
34 }).then(function (res) { 34 }).then(function (res) {
35 if (typeof (callback) == "function") callback(res.data) 35 if (typeof (callback) == "function") callback(res.data)
36 }).catch(function (error) { 36 }).catch(function (error) {
@@ -41,7 +41,7 @@ class MediaServer{ @@ -41,7 +41,7 @@ class MediaServer{
41 checkServer(param, callback){ 41 checkServer(param, callback){
42 this.$axios({ 42 this.$axios({
43 method: 'get', 43 method: 'get',
44 - url:`./api/server/media_server/check`, 44 + url:`/api/server/media_server/check`,
45 params: { 45 params: {
46 ip: param.ip, 46 ip: param.ip,
47 port: param.httpPort, 47 port: param.httpPort,
@@ -57,7 +57,7 @@ class MediaServer{ @@ -57,7 +57,7 @@ class MediaServer{
57 checkRecordServer(param, callback){ 57 checkRecordServer(param, callback){
58 this.$axios({ 58 this.$axios({
59 method: 'get', 59 method: 'get',
60 - url:`./api/server/media_server/record/check`, 60 + url:`/api/server/media_server/record/check`,
61 params: { 61 params: {
62 ip: param.ip, 62 ip: param.ip,
63 port: param.recordAssistPort 63 port: param.recordAssistPort
@@ -72,7 +72,7 @@ class MediaServer{ @@ -72,7 +72,7 @@ class MediaServer{
72 addServer(param, callback){ 72 addServer(param, callback){
73 this.$axios({ 73 this.$axios({
74 method: 'post', 74 method: 'post',
75 - url:`./api/server/media_server/save`, 75 + url:`/api/server/media_server/save`,
76 data: param 76 data: param
77 }).then(function (res) { 77 }).then(function (res) {
78 if (typeof (callback) == "function") callback(res.data) 78 if (typeof (callback) == "function") callback(res.data)
@@ -84,7 +84,7 @@ class MediaServer{ @@ -84,7 +84,7 @@ class MediaServer{
84 delete(id, callback) { 84 delete(id, callback) {
85 this.$axios({ 85 this.$axios({
86 method: 'delete', 86 method: 'delete',
87 - url:`./api/server/media_server/delete`, 87 + url:`/api/server/media_server/delete`,
88 params: { 88 params: {
89 id: id 89 id: id
90 } 90 }
web_src/src/main.js
@@ -37,13 +37,13 @@ Vue.use(VueClipboard); @@ -37,13 +37,13 @@ Vue.use(VueClipboard);
37 Vue.use(ElementUI); 37 Vue.use(ElementUI);
38 Vue.use(VueCookies); 38 Vue.use(VueCookies);
39 Vue.use(VueClipboards); 39 Vue.use(VueClipboards);
40 -Vue.prototype.$axios = axios; 40 +
41 Vue.prototype.$notify = Notification; 41 Vue.prototype.$notify = Notification;
42 Vue.use(Contextmenu); 42 Vue.use(Contextmenu);
43 Vue.use(VCharts); 43 Vue.use(VCharts);
44 44
45 -axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : "";  
46 - 45 +axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : (window.baseUrl?window.baseUrl:"");
  46 +axios.defaults.withCredentials = true;
47 // api 返回401自动回登陆页面 47 // api 返回401自动回登陆页面
48 axios.interceptors.response.use(function (response) { 48 axios.interceptors.response.use(function (response) {
49 // 对响应数据做点什么 49 // 对响应数据做点什么
@@ -56,7 +56,7 @@ axios.interceptors.response.use(function (response) { @@ -56,7 +56,7 @@ axios.interceptors.response.use(function (response) {
56 } 56 }
57 return Promise.reject(error); 57 return Promise.reject(error);
58 }); 58 });
59 - 59 +Vue.prototype.$axios = axios;
60 Vue.prototype.$cookies.config(60*30); 60 Vue.prototype.$cookies.config(60*30);
61 61
62 new Vue({ 62 new Vue({
web_src/static/js/mapConfig.js renamed to web_src/static/js/config.js
  1 +
  2 +window.baseUrl = ""
  3 +
1 // map组件全局参数, 注释此内容可以关闭地图功能 4 // map组件全局参数, 注释此内容可以关闭地图功能
2 window.mapParam = { 5 window.mapParam = {
3 // 开启/关闭地图功能 6 // 开启/关闭地图功能