diff --git a/doc/_content/ability/gis.md b/doc/_content/ability/gis.md index 8796dba0..f77a428c 100644 --- a/doc/_content/ability/gis.md +++ b/doc/_content/ability/gis.md @@ -14,7 +14,7 @@ WVP提供了简单的电子地图用于设备的定位以及移动设备的轨 PS: 目前的底图仅用用作演示和学习,商用情况请自行购买授权使用。 ### 更换底图以及底图配置 -目前WVP支持使用了更换底图,配置文件在web_src/static/js/mapConfig.js,请修改后重新编译前端文件。 +目前WVP支持使用了更换底图,配置文件在web_src/static/js/config.js,请修改后重新编译前端文件。 ```javascript window.mapParam = { // 开启/关闭地图功能 diff --git a/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java b/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java index 7133e14e..e30b6db3 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java @@ -48,6 +48,13 @@ public class ApiAccessFilter extends OncePerRequestFilter { long start = System.currentTimeMillis(); // 请求进入时间 String uriName = ApiSaveConstant.getVal(servletRequest.getRequestURI()); + String origin = servletRequest.getHeader("Origin"); + servletResponse.setContentType("application/json;charset=UTF-8"); + servletResponse.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*"); + servletResponse.setHeader("Access-Control-Allow-Credentials", "true"); + servletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT"); + servletResponse.setHeader("Access-Control-Max-Age", "3600"); + servletResponse.setHeader("Access-Control-Allow-Headers", "token,Content-Type,Content-Length, Authorization, Accept,X-Requested-With,domain,zdy"); filterChain.doFilter(servletRequest, servletResponse); if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) { @@ -65,9 +72,7 @@ public class ApiAccessFilter extends OncePerRequestFilter { logDto.setUri(servletRequest.getRequestURI()); logDto.setCreateTime(DateUtil.getNow()); logService.add(logDto); -// logger.warn("[Api Access] [{}] [{}] [{}] [{}] [{}] {}ms", -// uriName, servletRequest.getMethod(), servletRequest.getRequestURI(), servletRequest.getRemoteAddr(), HttpStatus.valueOf(servletResponse.getStatus()), -// System.currentTimeMillis() - start); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java b/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java index cd504208..35c68d5d 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/security/AnonymousAuthenticationEntryPoint.java @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf.security; import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import org.apache.poi.hssf.eventmodel.ERFListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.AuthenticationException; @@ -25,7 +24,10 @@ public class AnonymousAuthenticationEntryPoint implements AuthenticationEntryPoi @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) { // 允许跨域 - response.setHeader("Access-Control-Allow-Origin", "*"); + String origin = request.getHeader("Origin"); + response.setHeader("Access-Control-Allow-Credentials", "true"); + response.setHeader("Access-Control-Allow-Origin", origin != null ? origin : "*"); + response.setHeader("Access-Control-Allow-Methods", "PUT,POST, GET,DELETE,OPTIONS"); // 允许自定义请求头token(允许head跨域) response.setHeader("Access-Control-Allow-Headers", "token, Accept, Origin, X-Requested-With, Content-Type, Last-Modified"); response.setHeader("Content-type", "application/json;charset=UTF-8"); diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index a795e77b..a07a47cd 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -112,6 +112,7 @@ public class ZLMHttpHookListener { * 服务器定时上报时间,上报间隔可配置,默认10s上报一次 */ @ResponseBody + @PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8") public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveHookParam param) { @@ -135,6 +136,7 @@ public class ZLMHttpHookListener { * 播放器鉴权事件,rtsp/rtmp/http-flv/ws-flv/hls的播放都将触发此鉴权事件。 */ @ResponseBody + @PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8") public HookResult onPlay(@RequestBody OnPlayHookParam param) { if (logger.isDebugEnabled()) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java index 305d488a..5046faa0 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java @@ -30,7 +30,7 @@ import java.util.UUID; * 位置信息管理 */ @Tag(name = "位置信息管理") -@CrossOrigin + @RestController @RequestMapping("/api/position") public class MobilePositionController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java index d58d4314..b1ad3b9f 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java @@ -17,7 +17,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; * @data: 2021-01-20 */ @Tag(name = "SSE推送") -@CrossOrigin + @Controller @RequestMapping("/api") public class SseController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java index e030b176..00155308 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java @@ -6,24 +6,18 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; -import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener; import com.genersoft.iot.vmp.service.IDeviceAlarmService; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.sip.InvalidArgumentException; @@ -34,7 +28,7 @@ import java.util.Arrays; import java.util.List; @Tag(name = "报警信息管理") -@CrossOrigin + @RestController @RequestMapping("/api/alarm") public class AlarmController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java index 651d9ac5..eac68ca4 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java @@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; - import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -22,9 +21,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; @@ -34,7 +31,7 @@ import java.text.ParseException; import java.util.UUID; @Tag(name = "国标设备配置") -@CrossOrigin + @RestController @RequestMapping("/api/device/config") public class DeviceConfig { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java index ff0d8b4f..bf0acb5a 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java @@ -32,7 +32,7 @@ import java.text.ParseException; import java.util.UUID; @Tag(name = "国标设备控制") -@CrossOrigin + @RestController @RequestMapping("/api/device/control") public class DeviceControl { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java index c15d771a..7a8732c8 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java @@ -46,7 +46,7 @@ import java.util.*; @Tag(name = "国标设备查询", description = "国标设备查询") @SuppressWarnings("rawtypes") -@CrossOrigin + @RestController @RequestMapping("/api/device/query") public class DeviceQuery { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java index 447944a7..5e673729 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; @Tag(name = "视频流关联到级联平台") -@CrossOrigin + @RestController @RequestMapping("/api/gbStream") public class GbStreamController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java index d135fa2f..8e0e2012 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java @@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest; @Tag(name = "媒体流相关") @Controller -@CrossOrigin + @RequestMapping(value = "/api/media") public class MediaController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java index 40b65c33..7628f7ca 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java @@ -37,7 +37,7 @@ import java.util.List; * 级联平台管理 */ @Tag(name = "级联平台管理") -@CrossOrigin + @RestController @RequestMapping("/api/platform") public class PlatformController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java index c94dbf2c..958cc689 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java @@ -40,7 +40,7 @@ import java.util.List; import java.util.UUID; @Tag(name = "国标设备点播") -@CrossOrigin + @RestController @RequestMapping("/api/play") public class PlayController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java index eb6f997d..8bab3fd0 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java @@ -40,7 +40,7 @@ import java.util.UUID; * @author lin */ @Tag(name = "视频回放") -@CrossOrigin + @RestController @RequestMapping("/api/playback") public class PlaybackController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java index 171f57ca..e9ea457d 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java @@ -1,7 +1,12 @@ package com.genersoft.iot.vmp.vmanager.gb28181.ptz; - + import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.gb28181.bean.Device; +import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; +import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; +import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -10,23 +15,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; -import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; -import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; -import com.genersoft.iot.vmp.storager.IVideoManagerStorage; - import javax.sip.InvalidArgumentException; import javax.sip.SipException; import java.text.ParseException; import java.util.UUID; @Tag(name = "云台控制") -@CrossOrigin + @RestController @RequestMapping("/api/ptz") public class PtzController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java index c3b9c781..093b3240 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java @@ -36,7 +36,7 @@ import java.text.ParseException; import java.util.UUID; @Tag(name = "国标录像") -@CrossOrigin + @RestController @RequestMapping("/api/gb_record") public class GBRecordController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java index 42efbb1a..3cabb99f 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java @@ -6,25 +6,18 @@ import com.genersoft.iot.vmp.service.ILogService; import com.genersoft.iot.vmp.storager.dao.dto.LogDto; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; -import java.text.ParseException; - @Tag(name = "日志管理") -@CrossOrigin + @RestController @RequestMapping("/api/log") public class LogController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java index ec88b507..6e2aca37 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java @@ -14,7 +14,7 @@ //import org.springframework.web.bind.annotation.*; // //@Tag(name = "云端录像") -//@CrossOrigin +// //@RestController //@RequestMapping("/api/record") //public class RecordController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java index 6b8550db..ad2c13b6 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.vmanager.server; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; -import com.genersoft.iot.vmp.VManageBootstrap; import com.genersoft.iot.vmp.common.SystemAllInfo; import com.genersoft.iot.vmp.common.VersionPo; import com.genersoft.iot.vmp.conf.SipConfig; @@ -15,13 +14,10 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.service.*; import com.genersoft.iot.vmp.service.bean.MediaServerLoad; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; -import com.genersoft.iot.vmp.utils.SpringBeanFactory; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo; import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; -import gov.nist.javax.sip.SipStackImpl; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -31,14 +27,12 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; -import javax.sip.ListeningPoint; -import javax.sip.ObjectInUseException; -import javax.sip.SipProvider; -import java.util.*; +import java.util.ArrayList; +import java.util.List; @SuppressWarnings("rawtypes") @Tag(name = "服务控制") -@CrossOrigin + @RestController @RequestMapping("/api/server") public class ServerController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java index 65ec3d33..4a8522b6 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*; */ @Tag(name = "拉流代理", description = "") @Controller -@CrossOrigin + @RequestMapping(value = "/api/proxy") public class StreamProxyController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index 7506433f..66225688 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -41,7 +41,7 @@ import java.util.UUID; @Tag(name = "推流信息管理") @Controller -@CrossOrigin + @RequestMapping(value = "/api/push") public class StreamPushController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java index 769dca00..f34f1c4b 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java @@ -6,20 +6,16 @@ import com.genersoft.iot.vmp.service.IRoleService; import com.genersoft.iot.vmp.storager.dao.dto.Role; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; @Tag(name = "角色管理") -@CrossOrigin + @RestController @RequestMapping("/api/role") public class RoleController { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java index 157cb751..127e83b8 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java @@ -24,7 +24,7 @@ import javax.security.sasl.AuthenticationException; import java.util.List; @Tag(name = "用户管理") -@CrossOrigin + @RestController @RequestMapping("/api/user") public class UserController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java index be2bbc19..6f2fe544 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java @@ -18,7 +18,7 @@ import java.text.ParseException; /** * API兼容:设备控制 */ -@CrossOrigin + @RestController @RequestMapping(value = "/api/v1/control") public class ApiControlController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java index e6286d60..bd5d5ef3 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiController.java @@ -6,7 +6,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; * API兼容:系统接口 */ @Controller -@CrossOrigin + @RequestMapping(value = "/api/v1") public class ApiController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java index e5f42272..5065523e 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java @@ -20,7 +20,7 @@ import java.util.List; * API兼容:设备信息 */ @SuppressWarnings("unchecked") -@CrossOrigin + @RestController @RequestMapping(value = "/api/v1/device") public class ApiDeviceController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java index 5381a3ae..72a1b5da 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java @@ -26,7 +26,7 @@ import java.text.ParseException; * API兼容:实时直播 */ @SuppressWarnings(value = {"rawtypes", "unchecked"}) -@CrossOrigin + @RestController @RequestMapping(value = "/api/v1/stream") public class ApiStreamController { diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java index abefa42b..d503f153 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java @@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.storager.dao.dto.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -@CrossOrigin + @RestController @RequestMapping(value = "/auth") public class AuthController { diff --git a/web_src/build/utils.js b/web_src/build/utils.js index bc98c135..e534fb0f 100644 --- a/web_src/build/utils.js +++ b/web_src/build/utils.js @@ -47,8 +47,7 @@ exports.cssLoaders = function (options) { if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, - fallback: 'vue-style-loader', - publicPath: '../../' + fallback: 'vue-style-loader' }) } else { return ['vue-style-loader'].concat(loaders) diff --git a/web_src/config/index.js b/web_src/config/index.js index 6f0ca8bb..b1e1cbe1 100644 --- a/web_src/config/index.js +++ b/web_src/config/index.js @@ -8,18 +8,18 @@ module.exports = { dev: { // Paths - assetsSubDirectory: './static', - assetsPublicPath: './', + assetsSubDirectory: 'static', + assetsPublicPath: '/', proxyTable: { '/debug': { - target: 'http://localhost:38080', + target: 'http://localhost:18080', changeOrigin: true, pathRewrite: { '^/debug': '/' } }, '/static/snap': { - target: 'http://localhost:38080', + target: 'http://localhost:18080', changeOrigin: true, // pathRewrite: { // '^/static/snap': '/static/snap' @@ -61,7 +61,7 @@ module.exports = { // Paths assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'), assetsSubDirectory: './static', - assetsPublicPath: './', + assetsPublicPath: '/', /** * Source Maps diff --git a/web_src/index.html b/web_src/index.html index e338faad..778591ed 100644 --- a/web_src/index.html +++ b/web_src/index.html @@ -13,7 +13,7 @@ - +