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