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

This commit is contained in:
648540858 2023-03-05 09:53:26 +08:00
parent 013b7dee2e
commit 4c8b69c600
71 changed files with 173 additions and 191 deletions

View File

@ -14,7 +14,7 @@ WVP提供了简单的电子地图用于设备的定位以及移动设备的轨
PS 目前的底图仅用用作演示和学习,商用情况请自行购买授权使用。 PS 目前的底图仅用用作演示和学习,商用情况请自行购买授权使用。
### 更换底图以及底图配置 ### 更换底图以及底图配置
目前WVP支持使用了更换底图配置文件在web_src/static/js/mapConfig.js请修改后重新编译前端文件。 目前WVP支持使用了更换底图配置文件在web_src/static/js/config.js请修改后重新编译前端文件。
```javascript ```javascript
window.mapParam = { window.mapParam = {
// 开启/关闭地图功能 // 开启/关闭地图功能

View File

@ -48,6 +48,13 @@ public class ApiAccessFilter extends OncePerRequestFilter {
long start = System.currentTimeMillis(); // 请求进入时间 long start = System.currentTimeMillis(); // 请求进入时间
String uriName = ApiSaveConstant.getVal(servletRequest.getRequestURI()); String uriName = ApiSaveConstant.getVal(servletRequest.getRequestURI());
String origin = servletRequest.getHeader("Origin");
servletResponse.setContentType("application/json;charset=UTF-8");
servletResponse.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*");
servletResponse.setHeader("Access-Control-Allow-Credentials", "true");
servletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT");
servletResponse.setHeader("Access-Control-Max-Age", "3600");
servletResponse.setHeader("Access-Control-Allow-Headers", "token,Content-Type,Content-Length, Authorization, Accept,X-Requested-With,domain,zdy");
filterChain.doFilter(servletRequest, servletResponse); filterChain.doFilter(servletRequest, servletResponse);
if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) { if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) {
@ -65,9 +72,7 @@ public class ApiAccessFilter extends OncePerRequestFilter {
logDto.setUri(servletRequest.getRequestURI()); logDto.setUri(servletRequest.getRequestURI());
logDto.setCreateTime(DateUtil.getNow()); logDto.setCreateTime(DateUtil.getNow());
logService.add(logDto); logService.add(logDto);
// logger.warn("[Api Access] [{}] [{}] [{}] [{}] [{}] {}ms",
// uriName, servletRequest.getMethod(), servletRequest.getRequestURI(), servletRequest.getRemoteAddr(), HttpStatus.valueOf(servletResponse.getStatus()),
// System.currentTimeMillis() - start);
} }
} }

View File

@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf.security;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import org.apache.poi.hssf.eventmodel.ERFListener;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
@ -25,7 +24,10 @@ public class AnonymousAuthenticationEntryPoint implements AuthenticationEntryPoi
@Override @Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) { public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
// 允许跨域 // 允许跨域
response.setHeader("Access-Control-Allow-Origin", "*"); String origin = request.getHeader("Origin");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*");
response.setHeader("Access-Control-Allow-Methods", "PUT,POST, GET,DELETE,OPTIONS");
// 允许自定义请求头token(允许head跨域) // 允许自定义请求头token(允许head跨域)
response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified"); response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified");
response.setHeader("Content-type", "application/json;charset=UTF-8"); response.setHeader("Content-type", "application/json;charset=UTF-8");

View File

@ -112,6 +112,7 @@ public class ZLMHttpHookListener {
* 服务器定时上报时间上报间隔可配置默认10s上报一次 * 服务器定时上报时间上报间隔可配置默认10s上报一次
*/ */
@ResponseBody @ResponseBody
@PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8") @PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8")
public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveHookParam param) { public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveHookParam param) {
@ -135,6 +136,7 @@ public class ZLMHttpHookListener {
* 播放器鉴权事件rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件 * 播放器鉴权事件rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件
*/ */
@ResponseBody @ResponseBody
@PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8") @PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8")
public HookResult onPlay(@RequestBody OnPlayHookParam param) { public HookResult onPlay(@RequestBody OnPlayHookParam param) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {

View File

@ -30,7 +30,7 @@ import java.util.UUID;
* 位置信息管理 * 位置信息管理
*/ */
@Tag(name = "位置信息管理") @Tag(name = "位置信息管理")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/position") @RequestMapping("/api/position")
public class MobilePositionController { public class MobilePositionController {

View File

@ -17,7 +17,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
* @data: 2021-01-20 * @data: 2021-01-20
*/ */
@Tag(name = "SSE推送") @Tag(name = "SSE推送")
@CrossOrigin
@Controller @Controller
@RequestMapping("/api") @RequestMapping("/api")
public class SseController { public class SseController {

View File

@ -6,24 +6,18 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener;
import com.genersoft.iot.vmp.service.IDeviceAlarmService; import com.genersoft.iot.vmp.service.IDeviceAlarmService;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.sip.InvalidArgumentException; import javax.sip.InvalidArgumentException;
@ -34,7 +28,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
@Tag(name = "报警信息管理") @Tag(name = "报警信息管理")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/alarm") @RequestMapping("/api/alarm")
public class AlarmController { public class AlarmController {

View File

@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -22,9 +21,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.async.DeferredResult; import org.springframework.web.context.request.async.DeferredResult;
@ -34,7 +31,7 @@ import java.text.ParseException;
import java.util.UUID; import java.util.UUID;
@Tag(name = "国标设备配置") @Tag(name = "国标设备配置")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/device/config") @RequestMapping("/api/device/config")
public class DeviceConfig { public class DeviceConfig {

View File

@ -32,7 +32,7 @@ import java.text.ParseException;
import java.util.UUID; import java.util.UUID;
@Tag(name = "国标设备控制") @Tag(name = "国标设备控制")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/device/control") @RequestMapping("/api/device/control")
public class DeviceControl { public class DeviceControl {

View File

@ -46,7 +46,7 @@ import java.util.*;
@Tag(name = "国标设备查询", description = "国标设备查询") @Tag(name = "国标设备查询", description = "国标设备查询")
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/device/query") @RequestMapping("/api/device/query")
public class DeviceQuery { public class DeviceQuery {

View File

@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@Tag(name = "视频流关联到级联平台") @Tag(name = "视频流关联到级联平台")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/gbStream") @RequestMapping("/api/gbStream")
public class GbStreamController { public class GbStreamController {

View File

@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest;
@Tag(name = "媒体流相关") @Tag(name = "媒体流相关")
@Controller @Controller
@CrossOrigin
@RequestMapping(value = "/api/media") @RequestMapping(value = "/api/media")
public class MediaController { public class MediaController {

View File

@ -37,7 +37,7 @@ import java.util.List;
* 级联平台管理 * 级联平台管理
*/ */
@Tag(name = "级联平台管理") @Tag(name = "级联平台管理")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/platform") @RequestMapping("/api/platform")
public class PlatformController { public class PlatformController {

View File

@ -40,7 +40,7 @@ import java.util.List;
import java.util.UUID; import java.util.UUID;
@Tag(name = "国标设备点播") @Tag(name = "国标设备点播")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/play") @RequestMapping("/api/play")
public class PlayController { public class PlayController {

View File

@ -40,7 +40,7 @@ import java.util.UUID;
* @author lin * @author lin
*/ */
@Tag(name = "视频回放") @Tag(name = "视频回放")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/playback") @RequestMapping("/api/playback")
public class PlaybackController { public class PlaybackController {

View File

@ -2,6 +2,11 @@ package com.genersoft.iot.vmp.vmanager.gb28181.ptz;
import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -10,23 +15,16 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.async.DeferredResult; import org.springframework.web.context.request.async.DeferredResult;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import javax.sip.InvalidArgumentException; import javax.sip.InvalidArgumentException;
import javax.sip.SipException; import javax.sip.SipException;
import java.text.ParseException; import java.text.ParseException;
import java.util.UUID; import java.util.UUID;
@Tag(name = "云台控制") @Tag(name = "云台控制")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/ptz") @RequestMapping("/api/ptz")
public class PtzController { public class PtzController {

View File

@ -36,7 +36,7 @@ import java.text.ParseException;
import java.util.UUID; import java.util.UUID;
@Tag(name = "国标录像") @Tag(name = "国标录像")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/gb_record") @RequestMapping("/api/gb_record")
public class GBRecordController { public class GBRecordController {

View File

@ -6,25 +6,18 @@ import com.genersoft.iot.vmp.service.ILogService;
import com.genersoft.iot.vmp.storager.dao.dto.LogDto; import com.genersoft.iot.vmp.storager.dao.dto.LogDto;
import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
@Tag(name = "日志管理") @Tag(name = "日志管理")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/log") @RequestMapping("/api/log")
public class LogController { public class LogController {

View File

@ -14,7 +14,7 @@
//import org.springframework.web.bind.annotation.*; //import org.springframework.web.bind.annotation.*;
// //
//@Tag(name = "云端录像") //@Tag(name = "云端录像")
//@CrossOrigin //
//@RestController //@RestController
//@RequestMapping("/api/record") //@RequestMapping("/api/record")
//public class RecordController { //public class RecordController {

View File

@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.vmanager.server;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.VManageBootstrap;
import com.genersoft.iot.vmp.common.SystemAllInfo; import com.genersoft.iot.vmp.common.SystemAllInfo;
import com.genersoft.iot.vmp.common.VersionPo; import com.genersoft.iot.vmp.common.VersionPo;
import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.SipConfig;
@ -15,13 +14,10 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.*; import com.genersoft.iot.vmp.service.*;
import com.genersoft.iot.vmp.service.bean.MediaServerLoad; import com.genersoft.iot.vmp.service.bean.MediaServerLoad;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.utils.SpringBeanFactory;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo;
import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo;
import gov.nist.javax.sip.SipStackImpl;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -31,14 +27,12 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.sip.ListeningPoint; import java.util.ArrayList;
import javax.sip.ObjectInUseException; import java.util.List;
import javax.sip.SipProvider;
import java.util.*;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@Tag(name = "服务控制") @Tag(name = "服务控制")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/server") @RequestMapping("/api/server")
public class ServerController { public class ServerController {

View File

@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*;
*/ */
@Tag(name = "拉流代理", description = "") @Tag(name = "拉流代理", description = "")
@Controller @Controller
@CrossOrigin
@RequestMapping(value = "/api/proxy") @RequestMapping(value = "/api/proxy")
public class StreamProxyController { public class StreamProxyController {

View File

@ -41,7 +41,7 @@ import java.util.UUID;
@Tag(name = "推流信息管理") @Tag(name = "推流信息管理")
@Controller @Controller
@CrossOrigin
@RequestMapping(value = "/api/push") @RequestMapping(value = "/api/push")
public class StreamPushController { public class StreamPushController {

View File

@ -6,20 +6,16 @@ import com.genersoft.iot.vmp.service.IRoleService;
import com.genersoft.iot.vmp.storager.dao.dto.Role; import com.genersoft.iot.vmp.storager.dao.dto.Role;
import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@Tag(name = "角色管理") @Tag(name = "角色管理")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/role") @RequestMapping("/api/role")
public class RoleController { public class RoleController {

View File

@ -24,7 +24,7 @@ import javax.security.sasl.AuthenticationException;
import java.util.List; import java.util.List;
@Tag(name = "用户管理") @Tag(name = "用户管理")
@CrossOrigin
@RestController @RestController
@RequestMapping("/api/user") @RequestMapping("/api/user")
public class UserController { public class UserController {

View File

@ -18,7 +18,7 @@ import java.text.ParseException;
/** /**
* API兼容设备控制 * API兼容设备控制
*/ */
@CrossOrigin
@RestController @RestController
@RequestMapping(value = "/api/v1/control") @RequestMapping(value = "/api/v1/control")
public class ApiControlController { public class ApiControlController {

View File

@ -6,7 +6,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
* API兼容系统接口 * API兼容系统接口
*/ */
@Controller @Controller
@CrossOrigin
@RequestMapping(value = "/api/v1") @RequestMapping(value = "/api/v1")
public class ApiController { public class ApiController {

View File

@ -20,7 +20,7 @@ import java.util.List;
* API兼容设备信息 * API兼容设备信息
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@CrossOrigin
@RestController @RestController
@RequestMapping(value = "/api/v1/device") @RequestMapping(value = "/api/v1/device")
public class ApiDeviceController { public class ApiDeviceController {

View File

@ -26,7 +26,7 @@ import java.text.ParseException;
* API兼容实时直播 * API兼容实时直播
*/ */
@SuppressWarnings(value = {"rawtypes", "unchecked"}) @SuppressWarnings(value = {"rawtypes", "unchecked"})
@CrossOrigin
@RestController @RestController
@RequestMapping(value = "/api/v1/stream") @RequestMapping(value = "/api/v1/stream")
public class ApiStreamController { public class ApiStreamController {

View File

@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.storager.dao.dto.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@CrossOrigin
@RestController @RestController
@RequestMapping(value = "/auth") @RequestMapping(value = "/auth")
public class AuthController { public class AuthController {

View File

@ -47,8 +47,7 @@ exports.cssLoaders = function (options) {
if (options.extract) { if (options.extract) {
return ExtractTextPlugin.extract({ return ExtractTextPlugin.extract({
use: loaders, use: loaders,
fallback: 'vue-style-loader', fallback: 'vue-style-loader'
publicPath: '../../'
}) })
} else { } else {
return ['vue-style-loader'].concat(loaders) return ['vue-style-loader'].concat(loaders)

View File

@ -8,18 +8,18 @@ module.exports = {
dev: { dev: {
// Paths // Paths
assetsSubDirectory: './static', assetsSubDirectory: 'static',
assetsPublicPath: './', assetsPublicPath: '/',
proxyTable: { proxyTable: {
'/debug': { '/debug': {
target: 'http://localhost:38080', target: 'http://localhost:18080',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/debug': '/' '^/debug': '/'
} }
}, },
'/static/snap': { '/static/snap': {
target: 'http://localhost:38080', target: 'http://localhost:18080',
changeOrigin: true, changeOrigin: true,
// pathRewrite: { // pathRewrite: {
// '^/static/snap': '/static/snap' // '^/static/snap': '/static/snap'
@ -61,7 +61,7 @@ module.exports = {
// Paths // Paths
assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'), assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'),
assetsSubDirectory: './static', assetsSubDirectory: './static',
assetsPublicPath: './', assetsPublicPath: '/',
/** /**
* Source Maps * Source Maps

View File

@ -13,7 +13,7 @@
<script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script> <script type="text/javascript" src="./static/js/EasyWasmPlayer.js"></script>
<script type="text/javascript" src="./static/js/liveplayer-lib.min.js"></script> <script type="text/javascript" src="./static/js/liveplayer-lib.min.js"></script>
<script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script> <script type="text/javascript" src="./static/js/ZLMRTCClient.js"></script>
<script type="text/javascript" src="./static/js/mapConfig.js"></script> <script type="text/javascript" src="./static/js/config.js"></script>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>

View File

@ -133,7 +133,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${that.mediaServerId}/api/record/list`, url:`/record_proxy/${that.mediaServerId}/api/record/list`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count
@ -185,7 +185,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'delete', method: 'delete',
url:`./record_proxy/api/record/delete`, url:`/record_proxy/api/record/delete`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count

View File

@ -241,7 +241,7 @@
let that = this; let that = this;
that.$axios({ that.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${that.mediaServerId}/api/record/file/list`, url:`/record_proxy/${that.mediaServerId}/api/record/file/list`,
params: { params: {
app: that.recordFile.app, app: that.recordFile.app,
stream: that.recordFile.stream, stream: that.recordFile.stream,
@ -340,7 +340,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'delete', method: 'delete',
url:`./record_proxy/${that.mediaServerId}/api/record/delete`, url:`/record_proxy/${that.mediaServerId}/api/record/delete`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count
@ -359,7 +359,7 @@
that.dateFilesObj = {}; that.dateFilesObj = {};
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${that.mediaServerId}/api/record/date/list`, url:`/record_proxy/${that.mediaServerId}/api/record/date/list`,
params: { params: {
app: that.recordFile.app, app: that.recordFile.app,
stream: that.recordFile.stream stream: that.recordFile.stream
@ -408,7 +408,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`,
params: { params: {
app: that.recordFile.app, app: that.recordFile.app,
stream: that.recordFile.stream, stream: that.recordFile.stream,
@ -433,7 +433,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`,
params: { params: {
isEnd: isEnd, isEnd: isEnd,
} }

View File

@ -152,7 +152,7 @@ export default {
this.getDeviceListLoading = true; this.getDeviceListLoading = true;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/devices`, url: `/api/device/query/devices`,
params: { params: {
page: this.currentPage, page: this.currentPage,
count: this.count count: this.count
@ -182,7 +182,7 @@ export default {
}).then(() => { }).then(() => {
this.$axios({ this.$axios({
method: 'delete', method: 'delete',
url: `./api/device/query/devices/${row.deviceId}/delete` url: `/api/device/query/devices/${row.deviceId}/delete`
}).then((res) => { }).then((res) => {
this.getDeviceList(); this.getDeviceList();
}).catch((error) => { }).catch((error) => {
@ -208,7 +208,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/device/query/devices/' + itemData.deviceId + '/sync' url: '/api/device/query/devices/' + itemData.deviceId + '/sync'
}).then((res) => { }).then((res) => {
console.log("刷新设备结果:" + JSON.stringify(res)); console.log("刷新设备结果:" + JSON.stringify(res));
if (res.data.code !== 0) { if (res.data.code !== 0) {
@ -242,7 +242,7 @@ export default {
await this.$axios({ await this.$axios({
method: 'get', method: 'get',
async: false, async: false,
url: `./api/device/query/${deviceId}/sync_status/`, url: `/api/device/query/${deviceId}/sync_status/`,
}).then((res) => { }).then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
if (res.data.data.errorMsg !== null) { if (res.data.data.errorMsg !== null) {
@ -261,7 +261,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: './api/device/query/transport/' + row.deviceId + '/' + row.streamMode url: '/api/device/query/transport/' + row.deviceId + '/' + row.streamMode
}).then(function (res) { }).then(function (res) {
}).catch(function (e) { }).catch(function (e) {

View File

@ -197,7 +197,7 @@
this.detailFiles = []; this.detailFiles = [];
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime
}).then((res)=>{ }).then((res)=>{
this.recordsLoading = false; this.recordsLoading = false;
if(res.data.code === 0) { if(res.data.code === 0) {
@ -249,7 +249,7 @@
} else { } else {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' +
this.endTime this.endTime
}).then((res)=> { }).then((res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -273,7 +273,7 @@
console.log('前端控制:播放'); console.log('前端控制:播放');
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/playback/resume/' + this.streamId url: '/api/playback/resume/' + this.streamId
}).then((res)=> { }).then((res)=> {
this.$refs["recordVideoPlayer"].play(this.videoUrl) this.$refs["recordVideoPlayer"].play(this.videoUrl)
}); });
@ -282,14 +282,14 @@
console.log('前端控制:暂停'); console.log('前端控制:暂停');
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/playback/pause/' + this.streamId url: '/api/playback/pause/' + this.streamId
}).then(function (res) {}); }).then(function (res) {});
}, },
gbScale(command){ gbScale(command){
console.log('前端控制:倍速 ' + command); console.log('前端控制:倍速 ' + command);
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/playback/speed/${this.streamId }/${command}` url: `/api/playback/speed/${this.streamId }/${command}`
}).then(function (res) {}); }).then(function (res) {});
}, },
downloadRecord: function (row) { downloadRecord: function (row) {
@ -311,7 +311,7 @@
}else { }else {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' + url: '/api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' +
row.endTime + '&downloadSpeed=4' row.endTime + '&downloadSpeed=4'
}).then( (res)=> { }).then( (res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -332,7 +332,7 @@
this.videoUrl = ''; this.videoUrl = '';
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId
}).then((res)=> { }).then((res)=> {
if (callback) callback(res) if (callback) callback(res)
}); });
@ -342,7 +342,7 @@
this.videoUrl = ''; this.videoUrl = '';
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
}).then(function (res) { }).then(function (res) {
if (callback) callback() if (callback) callback()
}); });

View File

@ -81,7 +81,7 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:"./api/user/login", url:"/api/user/login",
params: loginParam params: loginParam
}).then(function (res) { }).then(function (res) {
window.clearTimeout(timeoutTask) window.clearTimeout(timeoutTask)

View File

@ -128,7 +128,7 @@ export default {
var that = this; var that = this;
that.$axios({ that.$axios({
method: 'delete', method: 'delete',
url:`./api/platform/delete/${platform.serverGBId}` url:`/api/platform/delete/${platform.serverGBId}`
}).then(function (res) { }).then(function (res) {
if (res.data.code === 0) { if (res.data.code === 0) {
that.$message({ that.$message({
@ -162,7 +162,7 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/platform/query/${that.count}/${that.currentPage}` url:`/api/platform/query/${that.count}/${that.currentPage}`
}).then(function (res) { }).then(function (res) {
if (res.data.code === 0) { if (res.data.code === 0) {
that.total = res.data.data.total; that.total = res.data.data.total;

View File

@ -171,7 +171,7 @@ export default {
this.getDeviceListLoading = true; this.getDeviceListLoading = true;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/push/list`, url: `/api/push/list`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count, count: that.count,
@ -197,7 +197,7 @@ export default {
this.getListLoading = true; this.getListLoading = true;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/push/getPlayUrl', url: '/api/push/getPlayUrl',
params: { params: {
app: row.app, app: row.app,
stream: row.stream, stream: row.stream,
@ -223,7 +223,7 @@ export default {
let that = this; let that = this;
that.$axios({ that.$axios({
method: "post", method: "post",
url: "./api/push/stop", url: "/api/push/stop",
params: { params: {
app: row.app, app: row.app,
streamId: row.stream streamId: row.stream
@ -247,7 +247,7 @@ export default {
let that = this; let that = this;
that.$axios({ that.$axios({
method: "delete", method: "delete",
url: "./api/push/remove_form_gb", url: "/api/push/remove_form_gb",
data: row data: row
}).then((res) => { }).then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -274,7 +274,7 @@ export default {
let that = this; let that = this;
that.$axios({ that.$axios({
method: "delete", method: "delete",
url: "./api/push/batchStop", url: "/api/push/batchStop",
data: { data: {
gbStreams: this.multipleSelection gbStreams: this.multipleSelection
} }

View File

@ -167,7 +167,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/proxy/list`, url:`/api/proxy/list`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count
@ -190,7 +190,7 @@
addOnvif: function(){ addOnvif: function(){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/onvif/search?timeout=3000`, url:`/api/onvif/search?timeout=3000`,
}).then((res) =>{ }).then((res) =>{
if (res.data.code === 0 ){ if (res.data.code === 0 ){
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
@ -218,7 +218,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/push/getPlayUrl`, url:`/api/push/getPlayUrl`,
params: { params: {
app: row.app, app: row.app,
stream: row.stream, stream: row.stream,
@ -247,7 +247,7 @@
let that = this; let that = this;
that.$axios({ that.$axios({
method:"delete", method:"delete",
url:"./api/proxy/del", url:"/api/proxy/del",
params:{ params:{
app: row.app, app: row.app,
stream: row.stream stream: row.stream
@ -263,7 +263,7 @@
this.$set(row, 'startBtnLoading', true) this.$set(row, 'startBtnLoading', true)
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/proxy/start`, url:`/api/proxy/start`,
params: { params: {
app: row.app, app: row.app,
stream: row.stream stream: row.stream
@ -295,7 +295,7 @@
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/proxy/stop`, url:`/api/proxy/stop`,
params: { params: {
app: row.app, app: row.app,
stream: row.stream stream: row.stream

View File

@ -99,7 +99,7 @@ export default {
this.getUserListLoading = true; this.getUserListLoading = true;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/user/users`, url: `/api/user/users`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count count: that.count
@ -141,7 +141,7 @@ export default {
}).then(() => { }).then(() => {
this.$axios({ this.$axios({
method: 'delete', method: 'delete',
url: `./api/user/delete?id=${row.id}` url: `/api/user/delete?id=${row.id}`
}).then((res) => { }).then((res) => {
this.getUserList(); this.getUserList();
}).catch((error) => { }).catch((error) => {

View File

@ -206,7 +206,7 @@ export default {
if (typeof (this.$route.params.deviceId) == "undefined") return; if (typeof (this.$route.params.deviceId) == "undefined") return;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/devices/${this.$route.params.deviceId}/channels`, url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count, count: that.count,
@ -238,7 +238,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/play/start/' + deviceId + '/' + channelId url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) { }).then(function (res) {
console.log(res) console.log(res)
that.isLoging = false; that.isLoging = false;
@ -278,7 +278,7 @@ export default {
var that = this; var that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/play/stop/' + this.deviceId + "/" + itemData.channelId url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId
}).then(function (res) { }).then(function (res) {
that.initData(); that.initData();
}).catch(function (error) { }).catch(function (error) {
@ -334,7 +334,7 @@ export default {
if (!this.showTree) { if (!this.showTree) {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`,
params: { params: {
page: this.currentPage, page: this.currentPage,
count: this.count, count: this.count,
@ -358,7 +358,7 @@ export default {
}else { }else {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/tree/channel/${this.deviceId}`, url: `/api/device/query/tree/channel/${this.deviceId}`,
params: { params: {
parentId: this.parentChannelId, parentId: this.parentChannelId,
page: this.currentPage, page: this.currentPage,
@ -387,7 +387,7 @@ export default {
updateChannel: function (row) { updateChannel: function (row) {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: `./api/device/query/channel/update/${this.deviceId}`, url: `/api/device/query/channel/update/${this.deviceId}`,
params: row params: row
}).then(function (res) { }).then(function (res) {
console.log(JSON.stringify(res)); console.log(JSON.stringify(res));

View File

@ -114,7 +114,7 @@ export default {
getSystemInfo: function (){ getSystemInfo: function (){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/server/system/info`, url: `/api/server/system/info`,
}).then( (res)=> { }).then( (res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$refs.consoleCPU.setData(res.data.data.cpu) this.$refs.consoleCPU.setData(res.data.data.cpu)
@ -128,7 +128,7 @@ export default {
getLoad: function (){ getLoad: function (){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/server/media_server/load`, url: `/api/server/media_server/load`,
}).then( (res)=> { }).then( (res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$refs.consoleNodeLoad.setData(res.data.data) this.$refs.consoleNodeLoad.setData(res.data.data)
@ -139,7 +139,7 @@ export default {
getResourceInfo: function (){ getResourceInfo: function (){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/server/resource/info`, url: `/api/server/resource/info`,
}).then( (res)=> { }).then( (res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$refs.consoleResource.setData(res.data.data) this.$refs.consoleResource.setData(res.data.data)
@ -151,7 +151,7 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/server/system/configInfo`, url: `/api/server/system/configInfo`,
}).then( (res)=> { }).then( (res)=> {
console.log(res) console.log(res)
if (res.data.code === 0) { if (res.data.code === 0) {

View File

@ -335,7 +335,7 @@ export default {
var that = this; var that = this;
await that.$axios({ await that.$axios({
method: 'get', method: 'get',
url:`./api/platform/exit/${deviceGbId}` url:`/api/platform/exit/${deviceGbId}`
}).then(function (res) { }).then(function (res) {
result = res.data; result = res.data;
}).catch(function (error) { }).catch(function (error) {

View File

@ -195,7 +195,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/platform/query/10000/1` url:`/api/platform/query/10000/1`
}).then(function (res) { }).then(function (res) {
that.platformList = res.data.data.list; that.platformList = res.data.data.list;
}).catch(function (error) { }).catch(function (error) {
@ -212,7 +212,7 @@ export default {
if (that.proxyParam.mediaServerId !== "auto"){ if (that.proxyParam.mediaServerId !== "auto"){
that.$axios({ that.$axios({
method: 'get', method: 'get',
url:`./api/proxy/ffmpeg_cmd/list`, url:`/api/proxy/ffmpeg_cmd/list`,
params: { params: {
mediaServerId: that.proxyParam.mediaServerId mediaServerId: that.proxyParam.mediaServerId
} }
@ -230,7 +230,7 @@ export default {
this.noneReaderHandler(); this.noneReaderHandler();
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:`./api/proxy/save`, url:`/api/proxy/save`,
data: this.proxyParam data: this.proxyParam
}).then((res)=> { }).then((res)=> {
this.dialogLoading = false; this.dialogLoading = false;
@ -261,7 +261,7 @@ export default {
var that = this; var that = this;
await that.$axios({ await that.$axios({
method: 'get', method: 'get',
url:`./api/platform/exit/${deviceGbId}` url:`/api/platform/exit/${deviceGbId}`
}).then(function (res) { }).then(function (res) {
result = res.data; result = res.data;
}).catch(function (error) { }).catch(function (error) {

View File

@ -55,7 +55,7 @@ export default {
getProgress(){ getProgress(){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/device/query/${this.deviceId}/sync_status/`, url:`/api/device/query/${this.deviceId}/sync_status/`,
}).then((res) => { }).then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
if (!this.syncFlag) { if (!this.syncFlag) {

View File

@ -100,7 +100,7 @@ export default {
onSubmit: function () { onSubmit: function () {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: "./api/user/add", url: "/api/user/add",
params: { params: {
username: this.username, username: this.username,
password: this.password, password: this.password,
@ -139,7 +139,7 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: "./api/role/all" url: "/api/role/all"
}).then((res) => { }).then((res) => {
this.loading = true; this.loading = true;
if (res.data.code === 0) { if (res.data.code === 0) {

View File

@ -116,7 +116,7 @@ export default {
console.log(this.form); console.log(this.form);
this.$axios({ this.$axios({
method:"post", method:"post",
url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
data: this.form data: this.form
}).then((res)=> { }).then((res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {

View File

@ -90,7 +90,7 @@ export default {
onSubmit: function () { onSubmit: function () {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:"./api/user/changePassword", url:"/api/user/changePassword",
params: { params: {
oldPassword: crypto.createHash('md5').update(this.oldPassword, "utf8").digest('hex'), oldPassword: crypto.createHash('md5').update(this.oldPassword, "utf8").digest('hex'),
password: this.newPassword password: this.newPassword

View File

@ -85,7 +85,7 @@ export default {
onSubmit: function () { onSubmit: function () {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:"./api/user/changePasswordForAdmin", url:"/api/user/changePasswordForAdmin",
params: { params: {
password: this.newPassword, password: this.newPassword,
userId: this.form.id, userId: this.form.id,

View File

@ -65,7 +65,7 @@ export default {
onSubmit: function () { onSubmit: function () {
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:"./api/user/changePushKey", url:"/api/user/changePushKey",
params: { params: {
pushKey: this.newPushKey, pushKey: this.newPushKey,
userId: this.form.id, userId: this.form.id,

View File

@ -44,7 +44,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/play/start/' + deviceId + '/' + channelId url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) { }).then(function (res) {
that.isLoging = false; that.isLoging = false;
if (res.data.code === 0) { if (res.data.code === 0) {

View File

@ -98,7 +98,7 @@ export default {
this.$axios({ this.$axios({
method:"post", method:"post",
url:"./api/platform/update_channel_for_gb", url:"/api/platform/update_channel_for_gb",
data:{ data:{
platformId: that.platformId, platformId: that.platformId,
channelReduces: that.chooseData channelReduces: that.chooseData

View File

@ -82,7 +82,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method:"get", method:"get",
url:`./api/platform/catalog`, url:`/api/platform/catalog`,
params: { params: {
platformId: that.platformId, platformId: that.platformId,
parentId: parentId parentId: parentId
@ -134,7 +134,7 @@ export default {
removeCatalog: function (id, node){ removeCatalog: function (id, node){
this.$axios({ this.$axios({
method:"delete", method:"delete",
url:`./api/platform/catalog/del`, url:`/api/platform/catalog/del`,
params: { params: {
id: id, id: id,
platformId: this.platformId, platformId: this.platformId,
@ -156,7 +156,7 @@ export default {
setDefaultCatalog: function (id){ setDefaultCatalog: function (id){
this.$axios({ this.$axios({
method:"post", method:"post",
url:`./api/platform/catalog/default/update`, url:`/api/platform/catalog/default/update`,
params: { params: {
platformId: this.platformId, platformId: this.platformId,
catalogId: id, catalogId: id,
@ -201,7 +201,7 @@ export default {
onClick: () => { onClick: () => {
this.$axios({ this.$axios({
method:"delete", method:"delete",
url:"./api/platform/catalog/relation/del", url:"/api/platform/catalog/relation/del",
data: data data: data
}).then((res)=>{ }).then((res)=>{
console.log("移除成功") console.log("移除成功")

View File

@ -121,7 +121,7 @@ export default {
this.getCatalogFromUser((catalogId)=> { this.getCatalogFromUser((catalogId)=> {
this.$axios({ this.$axios({
method:"post", method:"post",
url:"./api/platform/update_channel_for_gb", url:"/api/platform/update_channel_for_gb",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
all: all, all: all,
@ -149,7 +149,7 @@ export default {
this.$axios({ this.$axios({
method:"delete", method:"delete",
url:"./api/platform/del_channel_for_gb", url:"/api/platform/del_channel_for_gb",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
all: all, all: all,
@ -248,7 +248,7 @@ export default {
this.$axios({ this.$axios({
method:"get", method:"get",
url:`./api/platform/channel_list`, url:`/api/platform/channel_list`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count, count: that.count,
@ -290,7 +290,7 @@ export default {
}).then(() => { }).then(() => {
this.$axios({ this.$axios({
method:"delete", method:"delete",
url:"./api/platform/del_channel_for_gb", url:"/api/platform/del_channel_for_gb",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
channelReduces: this.multipleSelection channelReduces: this.multipleSelection
@ -310,7 +310,7 @@ export default {
this.$axios({ this.$axios({
method: "post", method: "post",
url: "./api/platform/update_channel_for_gb", url: "/api/platform/update_channel_for_gb",
data: { data: {
platformId: this.platformId, platformId: this.platformId,
channelReduces: this.multipleSelection, channelReduces: this.multipleSelection,

View File

@ -134,7 +134,7 @@ export default {
this.getCatalogFromUser((catalogId)=>{ this.getCatalogFromUser((catalogId)=>{
this.$axios({ this.$axios({
method:"post", method:"post",
url:"./api/gbStream/add", url:"/api/gbStream/add",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
catalogId: catalogId, catalogId: catalogId,
@ -163,7 +163,7 @@ export default {
this.$axios({ this.$axios({
method:"delete", method:"delete",
url:"./api/gbStream/del", url:"/api/gbStream/del",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
all: all, all: all,
@ -186,7 +186,7 @@ export default {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/gbStream/list`, url:`/api/gbStream/list`,
params: { params: {
page: that.currentPage, page: that.currentPage,
count: that.count, count: that.count,
@ -222,7 +222,7 @@ export default {
}).then(() => { }).then(() => {
this.$axios({ this.$axios({
method:"delete", method:"delete",
url:"./api/gbStream/del", url:"/api/gbStream/del",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
gbStreams: this.multipleSelection, gbStreams: this.multipleSelection,
@ -242,7 +242,7 @@ export default {
this.getCatalogFromUser((catalogId)=>{ this.getCatalogFromUser((catalogId)=>{
this.$axios({ this.$axios({
method:"post", method:"post",
url:"./api/gbStream/add", url:"/api/gbStream/add",
data:{ data:{
platformId: this.platformId, platformId: this.platformId,
catalogId: catalogId, catalogId: catalogId,

View File

@ -131,7 +131,7 @@ export default {
this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0 this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:`./api/device/query/device/${this.isEdit?'update':'add'}/`, url:`/api/device/query/device/${this.isEdit?'update':'add'}/`,
params: this.form params: this.form
}).then((res) => { }).then((res) => {
console.log(res.data) console.log(res.data)

View File

@ -320,7 +320,7 @@ export default {
if (tab.name === "codec") { if (tab.name === "codec") {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId
}).then(function (res) { }).then(function (res) {
that.tracksLoading = false; that.tracksLoading = false;
if (res.data.code == 0 && res.data.tracks) { if (res.data.code == 0 && res.data.tracks) {
@ -397,7 +397,7 @@ export default {
this.$refs[this.activePlayer].pause() this.$refs[this.activePlayer].pause()
that.$axios({ that.$axios({
method: 'post', method: 'post',
url: './api/play/convert/' + that.streamId url: '/api/play/convert/' + that.streamId
}).then(function (res) { }).then(function (res) {
if (res.data.code === 0) { if (res.data.code === 0) {
that.convertKey = res.data.key; that.convertKey = res.data.key;
@ -434,7 +434,7 @@ export default {
that.$refs.videoPlayer.pause() that.$refs.videoPlayer.pause()
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: './api/play/convertStop/' + this.convertKey url: '/api/play/convertStop/' + this.convertKey
}).then(function (res) { }).then(function (res) {
if (res.data.code == 0) { if (res.data.code == 0) {
console.log(res.data.msg) console.log(res.data.msg)
@ -494,7 +494,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: './api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed
}).then(function (res) {}); }).then(function (res) {});
}, },
//////////////////////////////////////////////// ////////////////////////////////////////////////
@ -506,7 +506,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0' url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0'
}).then(function (res) {}); }).then(function (res) {});
}, },
setSpeedOrTime: function (cmdCode, groupNum, parameter) { setSpeedOrTime: function (cmdCode, groupNum, parameter) {
@ -516,7 +516,7 @@ export default {
console.log('前端控制0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); console.log('前端控制0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16));
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2 url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2
}).then(function (res) {}); }).then(function (res) {});
}, },
setCommand: function (cmdCode, groupNum, parameter) { setCommand: function (cmdCode, groupNum, parameter) {
@ -524,7 +524,7 @@ export default {
console.log('前端控制0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); console.log('前端控制0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0');
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0' url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0'
}).then(function (res) {}); }).then(function (res) {});
}, },
copyUrl: function (dropdownItem){ copyUrl: function (dropdownItem){

View File

@ -89,7 +89,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method:"get", method:"get",
url:`./api/platform/catalog`, url:`/api/platform/catalog`,
params: { params: {
platformId: that.platformId, platformId: that.platformId,
parentId: parentId parentId: parentId
@ -111,7 +111,7 @@ export default {
if (node.level === 0) { if (node.level === 0) {
this.$axios({ this.$axios({
method:"get", method:"get",
url:`./api/platform/info/` + this.platformId, url:`/api/platform/info/` + this.platformId,
}) })
.then((res)=> { .then((res)=> {
if (res.data.code === 0) { if (res.data.code === 0) {

View File

@ -60,7 +60,7 @@ export default {
console.log(this.form); console.log(this.form);
this.$axios({ this.$axios({
method:"post", method:"post",
url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
data: this.form data: this.form
}) })
.then((res)=> { .then((res)=> {

View File

@ -81,7 +81,7 @@ export default {
console.log(this.form); console.log(this.form);
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/onvif/rtsp`, url:`/api/onvif/rtsp`,
params: { params: {
hostname: this.form.hostName, hostname: this.form.hostName,
timeout: 3000, timeout: 3000,

View File

@ -138,7 +138,7 @@ export default {
showDialog: false, showDialog: false,
isLoging: false, isLoging: false,
onSubmit_text: "立即创建", onSubmit_text: "立即创建",
saveUrl: "./api/platform/save", saveUrl: "/api/platform/save",
platform: { platform: {
id: null, id: null,
@ -192,7 +192,7 @@ export default {
this.saveUrl = "/api/platform/add"; this.saveUrl = "/api/platform/add";
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/platform/server_config` url:`/api/platform/server_config`
}).then(function (res) { }).then(function (res) {
console.log(res); console.log(res);
if (res.data.code === 0) { if (res.data.code === 0) {
@ -315,7 +315,7 @@ export default {
var that = this; var that = this;
await that.$axios({ await that.$axios({
method: 'get', method: 'get',
url:`./api/platform/exit/${deviceGbId}`}) url:`/api/platform/exit/${deviceGbId}`})
.then(function (res) { .then(function (res) {
if (res.data.code === 0) { if (res.data.code === 0) {
result = res.data.data; result = res.data.data;

View File

@ -109,7 +109,7 @@ export default {
if (this.edit) { if (this.edit) {
this.$axios({ this.$axios({
method:"post", method:"post",
url:`./api/push/save_to_gb`, url:`/api/push/save_to_gb`,
data: this.proxyParam data: this.proxyParam
}).then( (res) => { }).then( (res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -129,7 +129,7 @@ export default {
}else { }else {
this.$axios({ this.$axios({
method:"post", method:"post",
url:`./api/push/add`, url:`/api/push/add`,
data: this.proxyParam data: this.proxyParam
}).then( (res) => { }).then( (res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
@ -159,7 +159,7 @@ export default {
var that = this; var that = this;
await that.$axios({ await that.$axios({
method:"get", method:"get",
url:`./api/platform/exit/${deviceGbId}` url:`/api/platform/exit/${deviceGbId}`
}).then(function (res) { }).then(function (res) {
result = res.data; result = res.data;
}).catch(function (error) { }).catch(function (error) {

View File

@ -72,7 +72,7 @@ export default {
onSubmit: function () { onSubmit: function () {
console.log("onSubmit"); console.log("onSubmit");
this.isLoging = true; this.isLoging = true;
let url = `./api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`; let url = `/api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`;
if (this.channel.channelId) { if (this.channel.channelId) {
url+="&channelId=${this.channel.channelId}" url+="&channelId=${this.channel.channelId}"
} }

View File

@ -71,7 +71,7 @@ export default {
getProgress: function (callback){ getProgress: function (callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}` url: `/api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}`
}).then((res)=> { }).then((res)=> {
console.log(res) console.log(res)
if (res.data.code === 0) { if (res.data.code === 0) {
@ -124,7 +124,7 @@ export default {
stopDownloadRecord: function (callback) { stopDownloadRecord: function (callback) {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream
}).then((res)=> { }).then((res)=> {
if (callback) callback(res) if (callback) callback(res)
}); });
@ -132,7 +132,7 @@ export default {
getFileDownload: function (){ getFileDownload: function (){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/add`, url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/add`,
params: { params: {
app: this.app, app: this.app,
stream: this.stream, stream: this.stream,
@ -164,7 +164,7 @@ export default {
getProgressForFile: function (callback){ getProgressForFile: function (callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/list`, url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/list`,
params: { params: {
app: this.app, app: this.app,
stream: this.stream, stream: this.stream,

View File

@ -135,7 +135,7 @@ export default {
this.loading = true this.loading = true
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/play/start/' + deviceId + '/' + channelId url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) { }).then(function (res) {
if (res.data.code === 0 && res.data.data) { if (res.data.code === 0 && res.data.data) {
let videoUrl; let videoUrl;

View File

@ -298,7 +298,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: './api/play/start/' + deviceId + '/' + channelId url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) { }).then(function (res) {
that.isLoging = false; that.isLoging = false;
if (res.data.code === 0) { if (res.data.code === 0) {

View File

@ -9,7 +9,7 @@ class DeviceService{
getDeviceList(currentPage, count, callback, errorCallback){ getDeviceList(currentPage, count, callback, errorCallback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/device/query/devices`, url:`/api/device/query/devices`,
params: { params: {
page: currentPage, page: currentPage,
count: count count: count
@ -25,7 +25,7 @@ class DeviceService{
getDevice(deviceId, callback, errorCallback){ getDevice(deviceId, callback, errorCallback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/device/query/devices/${deviceId}`, url:`/api/device/query/devices/${deviceId}`,
}).then((res) => { }).then((res) => {
if (typeof (callback) == "function") callback(res.data) if (typeof (callback) == "function") callback(res.data)
}).catch((error) => { }).catch((error) => {
@ -82,7 +82,7 @@ class DeviceService{
getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) { getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/devices/${deviceId}/channels`, url: `/api/device/query/devices/${deviceId}/channels`,
params:{ params:{
page: currentPage, page: currentPage,
count: count, count: count,
@ -121,7 +121,7 @@ class DeviceService{
getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) { getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) {
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/sub_channels/${deviceId}/${channelId}/channels`, url: `/api/device/query/sub_channels/${deviceId}/${channelId}/channels`,
params:{ params:{
page: currentPage, page: currentPage,
count: count, count: count,
@ -161,7 +161,7 @@ class DeviceService{
} }
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: `./api/device/query/tree/${deviceId}`, url: `/api/device/query/tree/${deviceId}`,
params:{ params:{
page: currentPage, page: currentPage,
count: count, count: count,

View File

@ -9,7 +9,7 @@ class MediaServer{
getOnlineMediaServerList(callback){ getOnlineMediaServerList(callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/server/media_server/online/list`, url:`/api/server/media_server/online/list`,
}).then((res) => { }).then((res) => {
if (typeof (callback) == "function") callback(res.data) if (typeof (callback) == "function") callback(res.data)
}).catch((error) => { }).catch((error) => {
@ -19,7 +19,7 @@ class MediaServer{
getMediaServerList(callback){ getMediaServerList(callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/server/media_server/list`, url:`/api/server/media_server/list`,
}).then(function (res) { }).then(function (res) {
if (typeof (callback) == "function") callback(res.data) if (typeof (callback) == "function") callback(res.data)
}).catch(function (error) { }).catch(function (error) {
@ -30,7 +30,7 @@ class MediaServer{
getMediaServer(id, callback){ getMediaServer(id, callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/server/media_server/one/` + id, url:`/api/server/media_server/one/` + id,
}).then(function (res) { }).then(function (res) {
if (typeof (callback) == "function") callback(res.data) if (typeof (callback) == "function") callback(res.data)
}).catch(function (error) { }).catch(function (error) {
@ -41,7 +41,7 @@ class MediaServer{
checkServer(param, callback){ checkServer(param, callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/server/media_server/check`, url:`/api/server/media_server/check`,
params: { params: {
ip: param.ip, ip: param.ip,
port: param.httpPort, port: param.httpPort,
@ -57,7 +57,7 @@ class MediaServer{
checkRecordServer(param, callback){ checkRecordServer(param, callback){
this.$axios({ this.$axios({
method: 'get', method: 'get',
url:`./api/server/media_server/record/check`, url:`/api/server/media_server/record/check`,
params: { params: {
ip: param.ip, ip: param.ip,
port: param.recordAssistPort port: param.recordAssistPort
@ -72,7 +72,7 @@ class MediaServer{
addServer(param, callback){ addServer(param, callback){
this.$axios({ this.$axios({
method: 'post', method: 'post',
url:`./api/server/media_server/save`, url:`/api/server/media_server/save`,
data: param data: param
}).then(function (res) { }).then(function (res) {
if (typeof (callback) == "function") callback(res.data) if (typeof (callback) == "function") callback(res.data)
@ -84,7 +84,7 @@ class MediaServer{
delete(id, callback) { delete(id, callback) {
this.$axios({ this.$axios({
method: 'delete', method: 'delete',
url:`./api/server/media_server/delete`, url:`/api/server/media_server/delete`,
params: { params: {
id: id id: id
} }

View File

@ -37,13 +37,13 @@ Vue.use(VueClipboard);
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(VueCookies); Vue.use(VueCookies);
Vue.use(VueClipboards); Vue.use(VueClipboards);
Vue.prototype.$axios = axios;
Vue.prototype.$notify = Notification; Vue.prototype.$notify = Notification;
Vue.use(Contextmenu); Vue.use(Contextmenu);
Vue.use(VCharts); Vue.use(VCharts);
axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : ""; axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : (window.baseUrl?window.baseUrl:"");
axios.defaults.withCredentials = true;
// api 返回401自动回登陆页面 // api 返回401自动回登陆页面
axios.interceptors.response.use(function (response) { axios.interceptors.response.use(function (response) {
// 对响应数据做点什么 // 对响应数据做点什么
@ -56,7 +56,7 @@ axios.interceptors.response.use(function (response) {
} }
return Promise.reject(error); return Promise.reject(error);
}); });
Vue.prototype.$axios = axios;
Vue.prototype.$cookies.config(60*30); Vue.prototype.$cookies.config(60*30);
new Vue({ new Vue({

View File

@ -1,3 +1,6 @@
window.baseUrl = ""
// map组件全局参数, 注释此内容可以关闭地图功能 // map组件全局参数, 注释此内容可以关闭地图功能
window.mapParam = { window.mapParam = {
// 开启/关闭地图功能 // 开启/关闭地图功能