diff --git a/pom.xml b/pom.xml index 7b5306e0..bcc3c36a 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ org.springframework.boot - spring-boot-starter-tomcat + spring-boot-starter-jetty diff --git a/src/main/java/com/genersoft/iot/vmp/ServletInitializer.java b/src/main/java/com/genersoft/iot/vmp/ServletInitializer.java deleted file mode 100644 index d5639f2e..00000000 --- a/src/main/java/com/genersoft/iot/vmp/ServletInitializer.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.genersoft.iot.vmp; - -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -public class ServletInitializer extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(VManageBootstrap.class); - } - -} diff --git a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java index af3340dd..eab22079 100644 --- a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java +++ b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java @@ -1,20 +1,24 @@ package com.genersoft.iot.vmp; -import java.util.logging.LogManager; - import com.genersoft.iot.vmp.conf.druid.EnableDruidSupport; -import com.genersoft.iot.vmp.storager.impl.RedisCatchStorageImpl; import com.genersoft.iot.vmp.utils.GitUtil; import com.genersoft.iot.vmp.utils.SpringBeanFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.scheduling.annotation.EnableScheduling; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; +import java.util.Collections; + /** * 启动类 */ @@ -22,7 +26,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication @EnableScheduling @EnableDruidSupport -public class VManageBootstrap extends LogManager { +public class VManageBootstrap extends SpringBootServletInitializer { private final static Logger logger = LoggerFactory.getLogger(VManageBootstrap.class); @@ -41,6 +45,21 @@ public class VManageBootstrap extends LogManager { context.close(); VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); } - + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(VManageBootstrap.class); + } + + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + super.onStartup(servletContext); + + servletContext.setSessionTrackingModes( + Collections.singleton(SessionTrackingMode.COOKIE) + ); + SessionCookieConfig sessionCookieConfig = servletContext.getSessionCookieConfig(); + sessionCookieConfig.setHttpOnly(true); + + } } 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 d1e61c0a..7133e14e 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/ApiAccessFilter.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; import org.springframework.web.filter.OncePerRequestFilter; @@ -23,6 +24,7 @@ import java.io.IOException; * @author lin */ @WebFilter(filterName = "ApiAccessFilter", urlPatterns = "/api/*", asyncSupported=true) +@Component public class ApiAccessFilter extends OncePerRequestFilter { private final static Logger logger = LoggerFactory.getLogger(ApiAccessFilter.class); @@ -48,7 +50,7 @@ public class ApiAccessFilter extends OncePerRequestFilter { filterChain.doFilter(servletRequest, servletResponse); - if (uriName != null && userSetting.getLogInDatebase()) { + if (uriName != null && userSetting != null && userSetting.getLogInDatebase() != null && userSetting.getLogInDatebase()) { LogDto logDto = new LogDto(); logDto.setName(uriName); diff --git a/src/main/java/com/genersoft/iot/vmp/conf/ServiceInfo.java b/src/main/java/com/genersoft/iot/vmp/conf/ServiceInfo.java new file mode 100644 index 00000000..55fbcf48 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/conf/ServiceInfo.java @@ -0,0 +1,30 @@ +package com.genersoft.iot.vmp.conf; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.web.context.WebServerInitializedEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +@Component +public class ServiceInfo implements ApplicationListener { + + private final Logger logger = LoggerFactory.getLogger(ServiceInfo.class); + + private static int serverPort; + + public static int getServerPort() { + return serverPort; + } + + @Override + public void onApplicationEvent(WebServerInitializedEvent event) { + // 项目启动获取启动的端口号 + ServiceInfo.serverPort = event.getWebServer().getPort(); + logger.info("项目启动获取启动的端口号: " + ServiceInfo.serverPort); + } + + public void setServerPort(int serverPort) { + ServiceInfo.serverPort = serverPort; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/UrlTokenHandler.java b/src/main/java/com/genersoft/iot/vmp/conf/security/UrlTokenHandler.java deleted file mode 100644 index e63aca4a..00000000 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/UrlTokenHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.genersoft.iot.vmp.conf.security; - -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.SessionCookieConfig; -import javax.servlet.SessionTrackingMode; -import java.util.Collections; - -public class UrlTokenHandler extends SpringBootServletInitializer { - - @Override - public void onStartup(ServletContext servletContext) throws ServletException { - super.onStartup(servletContext); - - servletContext.setSessionTrackingModes( - Collections.singleton(SessionTrackingMode.COOKIE) - ); - SessionCookieConfig sessionCookieConfig = servletContext.getSessionCookieConfig(); - sessionCookieConfig.setHttpOnly(true); - - } -} diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java index 0f37bde6..f4ab70ef 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java @@ -1,5 +1,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; +import com.genersoft.iot.vmp.conf.ServiceInfo; import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper; @@ -79,6 +80,19 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen RequestEventExt evtExt = (RequestEventExt) evt; String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort(); logger.info("[注册请求] 开始处理: {}", requestAddress); +// MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer(); +// QueryExp protocol = Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")); +//// ObjectName name = new ObjectName("*:type=Connector,*"); +// ObjectName name = new ObjectName("*:*"); +// Set objectNames = beanServer.queryNames(name, protocol); +// for (ObjectName objectName : objectNames) { +// String catalina = objectName.getDomain(); +// if ("Catalina".equals(catalina)) { +// System.out.println(objectName.getKeyProperty("port")); +// } +// } + + System.out.println(ServiceInfo.getServerPort()); SIPRequest request = (SIPRequest)evt.getRequest(); Response response = null; boolean passwordCorrect = false; diff --git a/web_src/build/utils.js b/web_src/build/utils.js index e534fb0f..bc98c135 100644 --- a/web_src/build/utils.js +++ b/web_src/build/utils.js @@ -47,7 +47,8 @@ exports.cssLoaders = function (options) { if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, - fallback: 'vue-style-loader' + fallback: 'vue-style-loader', + publicPath: '../../' }) } else { return ['vue-style-loader'].concat(loaders) diff --git a/web_src/config/index.js b/web_src/config/index.js index c5a74528..6f0ca8bb 100644 --- a/web_src/config/index.js +++ b/web_src/config/index.js @@ -8,8 +8,8 @@ module.exports = { dev: { // Paths - assetsSubDirectory: 'static', - assetsPublicPath: '/', + assetsSubDirectory: './static', + assetsPublicPath: './', proxyTable: { '/debug': { target: 'http://localhost:38080', @@ -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/src/components/CloudRecord.vue b/web_src/src/components/CloudRecord.vue index b046fc91..bd374fc8 100644 --- a/web_src/src/components/CloudRecord.vue +++ b/web_src/src/components/CloudRecord.vue @@ -133,7 +133,7 @@ let that = this; this.$axios({ method: 'get', - url:`/record_proxy/${that.mediaServerId}/api/record/list`, + url:`./record_proxy/${that.mediaServerId}/api/record/list`, params: { page: that.currentPage, count: that.count @@ -185,7 +185,7 @@ let that = this; this.$axios({ method: 'delete', - url:`/record_proxy/api/record/delete`, + url:`./record_proxy/api/record/delete`, params: { page: that.currentPage, count: that.count diff --git a/web_src/src/components/CloudRecordDetail.vue b/web_src/src/components/CloudRecordDetail.vue index 80bb5b1a..d76101a2 100644 --- a/web_src/src/components/CloudRecordDetail.vue +++ b/web_src/src/components/CloudRecordDetail.vue @@ -241,7 +241,7 @@ let that = this; that.$axios({ method: 'get', - url:`/record_proxy/${that.mediaServerId}/api/record/file/list`, + url:`./record_proxy/${that.mediaServerId}/api/record/file/list`, params: { app: that.recordFile.app, stream: that.recordFile.stream, @@ -340,7 +340,7 @@ let that = this; this.$axios({ method: 'delete', - url:`/record_proxy/${that.mediaServerId}/api/record/delete`, + url:`./record_proxy/${that.mediaServerId}/api/record/delete`, params: { page: that.currentPage, count: that.count @@ -359,7 +359,7 @@ that.dateFilesObj = {}; this.$axios({ method: 'get', - url:`/record_proxy/${that.mediaServerId}/api/record/date/list`, + url:`./record_proxy/${that.mediaServerId}/api/record/date/list`, params: { app: that.recordFile.app, stream: that.recordFile.stream @@ -408,7 +408,7 @@ let that = this; this.$axios({ method: 'get', - url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, + url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, params: { app: that.recordFile.app, stream: that.recordFile.stream, @@ -433,7 +433,7 @@ let that = this; this.$axios({ method: 'get', - url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, + url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, params: { isEnd: isEnd, } diff --git a/web_src/src/components/DeviceList.vue b/web_src/src/components/DeviceList.vue index 29e049da..5f2495e3 100644 --- a/web_src/src/components/DeviceList.vue +++ b/web_src/src/components/DeviceList.vue @@ -152,7 +152,7 @@ export default { this.getDeviceListLoading = true; this.$axios({ method: 'get', - url: `/api/device/query/devices`, + url: `./api/device/query/devices`, params: { page: this.currentPage, count: this.count @@ -182,7 +182,7 @@ export default { }).then(() => { this.$axios({ method: 'delete', - url: `/api/device/query/devices/${row.deviceId}/delete` + url: `./api/device/query/devices/${row.deviceId}/delete` }).then((res) => { this.getDeviceList(); }).catch((error) => { @@ -208,7 +208,7 @@ export default { let that = this; this.$axios({ method: 'get', - url: '/api/device/query/devices/' + itemData.deviceId + '/sync' + url: './api/device/query/devices/' + itemData.deviceId + '/sync' }).then((res) => { console.log("刷新设备结果:" + JSON.stringify(res)); if (res.data.code !== 0) { @@ -242,7 +242,7 @@ export default { await this.$axios({ method: 'get', async: false, - url: `/api/device/query/${deviceId}/sync_status/`, + url: `./api/device/query/${deviceId}/sync_status/`, }).then((res) => { if (res.data.code == 0) { if (res.data.data.errorMsg !== null) { @@ -261,7 +261,7 @@ export default { let that = this; this.$axios({ method: 'post', - url: '/api/device/query/transport/' + row.deviceId + '/' + row.streamMode + url: './api/device/query/transport/' + row.deviceId + '/' + row.streamMode }).then(function (res) { }).catch(function (e) { diff --git a/web_src/src/components/GBRecordDetail.vue b/web_src/src/components/GBRecordDetail.vue index 6fe29a89..938792a6 100644 --- a/web_src/src/components/GBRecordDetail.vue +++ b/web_src/src/components/GBRecordDetail.vue @@ -197,7 +197,7 @@ this.detailFiles = []; this.$axios({ method: 'get', - url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime + url: './api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime }).then((res)=>{ this.recordsLoading = false; if(res.data.code === 0) { @@ -249,7 +249,7 @@ } else { this.$axios({ method: 'get', - url: '/api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + + url: './api/playback/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + this.startTime + '&endTime=' + this.endTime }).then((res)=> { if (res.data.code === 0) { @@ -273,7 +273,7 @@ console.log('前端控制:播放'); this.$axios({ method: 'get', - url: '/api/playback/resume/' + this.streamId + url: './api/playback/resume/' + this.streamId }).then((res)=> { this.$refs["recordVideoPlayer"].play(this.videoUrl) }); @@ -282,14 +282,14 @@ console.log('前端控制:暂停'); this.$axios({ method: 'get', - url: '/api/playback/pause/' + this.streamId + url: './api/playback/pause/' + this.streamId }).then(function (res) {}); }, gbScale(command){ console.log('前端控制:倍速 ' + command); this.$axios({ method: 'get', - url: `/api/playback/speed/${this.streamId }/${command}` + url: `./api/playback/speed/${this.streamId }/${command}` }).then(function (res) {}); }, downloadRecord: function (row) { @@ -311,7 +311,7 @@ }else { this.$axios({ method: 'get', - url: '/api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' + + url: './api/gb_record/download/start/' + this.deviceId + '/' + this.channelId + '?startTime=' + row.startTime + '&endTime=' + row.endTime + '&downloadSpeed=4' }).then( (res)=> { if (res.data.code === 0) { @@ -332,7 +332,7 @@ this.videoUrl = ''; this.$axios({ method: 'get', - url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId + url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId }).then((res)=> { if (callback) callback(res) }); @@ -342,7 +342,7 @@ this.videoUrl = ''; this.$axios({ method: 'get', - url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId + url: './api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId }).then(function (res) { if (callback) callback() }); diff --git a/web_src/src/components/Login.vue b/web_src/src/components/Login.vue index 37c8a83a..6346950d 100644 --- a/web_src/src/components/Login.vue +++ b/web_src/src/components/Login.vue @@ -81,7 +81,7 @@ export default { this.$axios({ method: 'get', - url:"/api/user/login", + url:"./api/user/login", params: loginParam }).then(function (res) { window.clearTimeout(timeoutTask) diff --git a/web_src/src/components/ParentPlatformList.vue b/web_src/src/components/ParentPlatformList.vue index 61e93fc8..262bddac 100644 --- a/web_src/src/components/ParentPlatformList.vue +++ b/web_src/src/components/ParentPlatformList.vue @@ -128,7 +128,7 @@ export default { var that = this; that.$axios({ method: 'delete', - url:`/api/platform/delete/${platform.serverGBId}` + url:`./api/platform/delete/${platform.serverGBId}` }).then(function (res) { if (res.data.code === 0) { that.$message({ @@ -162,7 +162,7 @@ export default { this.$axios({ method: 'get', - url:`/api/platform/query/${that.count}/${that.currentPage}` + url:`./api/platform/query/${that.count}/${that.currentPage}` }).then(function (res) { if (res.data.code === 0) { that.total = res.data.data.total; diff --git a/web_src/src/components/PushVideoList.vue b/web_src/src/components/PushVideoList.vue index 6aed98a3..5ca7194c 100644 --- a/web_src/src/components/PushVideoList.vue +++ b/web_src/src/components/PushVideoList.vue @@ -171,7 +171,7 @@ export default { this.getDeviceListLoading = true; this.$axios({ method: 'get', - url: `/api/push/list`, + url: `./api/push/list`, params: { page: that.currentPage, count: that.count, @@ -197,7 +197,7 @@ export default { this.getListLoading = true; this.$axios({ method: 'get', - url: '/api/push/getPlayUrl', + url: './api/push/getPlayUrl', params: { app: row.app, stream: row.stream, @@ -223,7 +223,7 @@ export default { let that = this; that.$axios({ method: "post", - url: "/api/push/stop", + url: "./api/push/stop", params: { app: row.app, streamId: row.stream @@ -247,7 +247,7 @@ export default { let that = this; that.$axios({ method: "delete", - url: "/api/push/remove_form_gb", + url: "./api/push/remove_form_gb", data: row }).then((res) => { if (res.data.code === 0) { @@ -274,7 +274,7 @@ export default { let that = this; that.$axios({ method: "delete", - url: "/api/push/batchStop", + url: "./api/push/batchStop", data: { gbStreams: this.multipleSelection } diff --git a/web_src/src/components/StreamProxyList.vue b/web_src/src/components/StreamProxyList.vue index 47ccde8b..f0cb7777 100644 --- a/web_src/src/components/StreamProxyList.vue +++ b/web_src/src/components/StreamProxyList.vue @@ -167,7 +167,7 @@ let that = this; this.$axios({ method: 'get', - url:`/api/proxy/list`, + url:`./api/proxy/list`, params: { page: that.currentPage, count: that.count @@ -190,7 +190,7 @@ addOnvif: function(){ this.$axios({ method: 'get', - url:`/api/onvif/search?timeout=3000`, + url:`./api/onvif/search?timeout=3000`, }).then((res) =>{ if (res.data.code === 0 ){ if (res.data.data.length > 0) { @@ -218,7 +218,7 @@ let that = this; this.$axios({ method: 'get', - url:`/api/push/getPlayUrl`, + url:`./api/push/getPlayUrl`, params: { app: row.app, stream: row.stream, @@ -247,7 +247,7 @@ let that = this; that.$axios({ method:"delete", - url:"/api/proxy/del", + url:"./api/proxy/del", params:{ app: row.app, stream: row.stream @@ -263,7 +263,7 @@ this.$set(row, 'startBtnLoading', true) this.$axios({ method: 'get', - url:`/api/proxy/start`, + url:`./api/proxy/start`, params: { app: row.app, stream: row.stream @@ -295,7 +295,7 @@ let that = this; this.$axios({ method: 'get', - url:`/api/proxy/stop`, + url:`./api/proxy/stop`, params: { app: row.app, stream: row.stream diff --git a/web_src/src/components/UserManager.vue b/web_src/src/components/UserManager.vue index c0fa695a..d012b135 100644 --- a/web_src/src/components/UserManager.vue +++ b/web_src/src/components/UserManager.vue @@ -99,7 +99,7 @@ export default { this.getUserListLoading = true; this.$axios({ method: 'get', - url: `/api/user/users`, + url: `./api/user/users`, params: { page: that.currentPage, count: that.count @@ -141,7 +141,7 @@ export default { }).then(() => { this.$axios({ method: 'delete', - url: `/api/user/delete?id=${row.id}` + url: `./api/user/delete?id=${row.id}` }).then((res) => { this.getUserList(); }).catch((error) => { diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index f020f345..e324bdc4 100644 --- a/web_src/src/components/channelList.vue +++ b/web_src/src/components/channelList.vue @@ -206,7 +206,7 @@ export default { if (typeof (this.$route.params.deviceId) == "undefined") return; this.$axios({ method: 'get', - url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`, + url: `./api/device/query/devices/${this.$route.params.deviceId}/channels`, params: { page: that.currentPage, count: that.count, @@ -238,7 +238,7 @@ export default { let that = this; this.$axios({ method: 'get', - url: '/api/play/start/' + deviceId + '/' + channelId + url: './api/play/start/' + deviceId + '/' + channelId }).then(function (res) { console.log(res) that.isLoging = false; @@ -278,7 +278,7 @@ export default { var that = this; this.$axios({ method: 'get', - url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId + url: './api/play/stop/' + this.deviceId + "/" + itemData.channelId }).then(function (res) { that.initData(); }).catch(function (error) { @@ -334,7 +334,7 @@ export default { if (!this.showTree) { this.$axios({ method: 'get', - url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, + url: `./api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`, params: { page: this.currentPage, count: this.count, @@ -358,7 +358,7 @@ export default { }else { this.$axios({ method: 'get', - url: `/api/device/query/tree/channel/${this.deviceId}`, + url: `./api/device/query/tree/channel/${this.deviceId}`, params: { parentId: this.parentChannelId, page: this.currentPage, @@ -387,7 +387,7 @@ export default { updateChannel: function (row) { this.$axios({ method: 'post', - url: `/api/device/query/channel/update/${this.deviceId}`, + url: `./api/device/query/channel/update/${this.deviceId}`, params: row }).then(function (res) { console.log(JSON.stringify(res)); diff --git a/web_src/src/components/console.vue b/web_src/src/components/console.vue index e192fb1b..2f5bb55e 100644 --- a/web_src/src/components/console.vue +++ b/web_src/src/components/console.vue @@ -114,7 +114,7 @@ export default { getSystemInfo: function (){ this.$axios({ method: 'get', - url: `/api/server/system/info`, + url: `./api/server/system/info`, }).then( (res)=> { if (res.data.code === 0) { this.$refs.consoleCPU.setData(res.data.data.cpu) @@ -128,7 +128,7 @@ export default { getLoad: function (){ this.$axios({ method: 'get', - url: `/api/server/media_server/load`, + url: `./api/server/media_server/load`, }).then( (res)=> { if (res.data.code === 0) { this.$refs.consoleNodeLoad.setData(res.data.data) @@ -139,7 +139,7 @@ export default { getResourceInfo: function (){ this.$axios({ method: 'get', - url: `/api/server/resource/info`, + url: `./api/server/resource/info`, }).then( (res)=> { if (res.data.code === 0) { this.$refs.consoleResource.setData(res.data.data) @@ -151,7 +151,7 @@ export default { this.$axios({ method: 'get', - url: `/api/server/system/configInfo`, + url: `./api/server/system/configInfo`, }).then( (res)=> { console.log(res) if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/MediaServerEdit.vue b/web_src/src/components/dialog/MediaServerEdit.vue index 9353a811..edb4ff67 100644 --- a/web_src/src/components/dialog/MediaServerEdit.vue +++ b/web_src/src/components/dialog/MediaServerEdit.vue @@ -335,7 +335,7 @@ export default { var that = this; await that.$axios({ method: 'get', - url:`/api/platform/exit/${deviceGbId}` + url:`./api/platform/exit/${deviceGbId}` }).then(function (res) { result = res.data; }).catch(function (error) { diff --git a/web_src/src/components/dialog/StreamProxyEdit.vue b/web_src/src/components/dialog/StreamProxyEdit.vue index 76011fac..c8efc140 100644 --- a/web_src/src/components/dialog/StreamProxyEdit.vue +++ b/web_src/src/components/dialog/StreamProxyEdit.vue @@ -195,7 +195,7 @@ export default { let that = this; this.$axios({ method: 'get', - url:`/api/platform/query/10000/1` + url:`./api/platform/query/10000/1` }).then(function (res) { that.platformList = res.data.data.list; }).catch(function (error) { @@ -212,7 +212,7 @@ export default { if (that.proxyParam.mediaServerId !== "auto"){ that.$axios({ method: 'get', - url:`/api/proxy/ffmpeg_cmd/list`, + url:`./api/proxy/ffmpeg_cmd/list`, params: { mediaServerId: that.proxyParam.mediaServerId } @@ -230,7 +230,7 @@ export default { this.noneReaderHandler(); this.$axios({ method: 'post', - url:`/api/proxy/save`, + url:`./api/proxy/save`, data: this.proxyParam }).then((res)=> { this.dialogLoading = false; @@ -261,7 +261,7 @@ export default { var that = this; await that.$axios({ method: 'get', - url:`/api/platform/exit/${deviceGbId}` + url:`./api/platform/exit/${deviceGbId}` }).then(function (res) { result = res.data; }).catch(function (error) { diff --git a/web_src/src/components/dialog/SyncChannelProgress.vue b/web_src/src/components/dialog/SyncChannelProgress.vue index e1c9fe01..6f4544b3 100644 --- a/web_src/src/components/dialog/SyncChannelProgress.vue +++ b/web_src/src/components/dialog/SyncChannelProgress.vue @@ -55,7 +55,7 @@ export default { getProgress(){ this.$axios({ method: 'get', - url:`/api/device/query/${this.deviceId}/sync_status/`, + url:`./api/device/query/${this.deviceId}/sync_status/`, }).then((res) => { if (res.data.code === 0) { if (!this.syncFlag) { diff --git a/web_src/src/components/dialog/addUser.vue b/web_src/src/components/dialog/addUser.vue index 8dc56827..9ac38aaa 100644 --- a/web_src/src/components/dialog/addUser.vue +++ b/web_src/src/components/dialog/addUser.vue @@ -100,7 +100,7 @@ export default { onSubmit: function () { this.$axios({ method: 'post', - url: "/api/user/add", + url: "./api/user/add", params: { username: this.username, password: this.password, @@ -139,7 +139,7 @@ export default { this.$axios({ method: 'get', - url: "/api/role/all" + url: "./api/role/all" }).then((res) => { this.loading = true; if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue index e1cd8d26..da2cc306 100644 --- a/web_src/src/components/dialog/catalogEdit.vue +++ b/web_src/src/components/dialog/catalogEdit.vue @@ -116,7 +116,7 @@ export default { console.log(this.form); this.$axios({ method:"post", - url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, + url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, data: this.form }).then((res)=> { if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/changePassword.vue b/web_src/src/components/dialog/changePassword.vue index 77e1d2a8..9b53b929 100644 --- a/web_src/src/components/dialog/changePassword.vue +++ b/web_src/src/components/dialog/changePassword.vue @@ -90,7 +90,7 @@ export default { onSubmit: function () { this.$axios({ method: 'post', - url:"/api/user/changePassword", + url:"./api/user/changePassword", params: { oldPassword: crypto.createHash('md5').update(this.oldPassword, "utf8").digest('hex'), password: this.newPassword diff --git a/web_src/src/components/dialog/changePasswordForAdmin.vue b/web_src/src/components/dialog/changePasswordForAdmin.vue index 5b913577..9c17d569 100644 --- a/web_src/src/components/dialog/changePasswordForAdmin.vue +++ b/web_src/src/components/dialog/changePasswordForAdmin.vue @@ -85,7 +85,7 @@ export default { onSubmit: function () { this.$axios({ method: 'post', - url:"/api/user/changePasswordForAdmin", + url:"./api/user/changePasswordForAdmin", params: { password: this.newPassword, userId: this.form.id, diff --git a/web_src/src/components/dialog/changePushKey.vue b/web_src/src/components/dialog/changePushKey.vue index 0b9834ef..9cc1684e 100644 --- a/web_src/src/components/dialog/changePushKey.vue +++ b/web_src/src/components/dialog/changePushKey.vue @@ -65,7 +65,7 @@ export default { onSubmit: function () { this.$axios({ method: 'post', - url:"/api/user/changePushKey", + url:"./api/user/changePushKey", params: { pushKey: this.newPushKey, userId: this.form.id, diff --git a/web_src/src/components/dialog/channelMapInfobox.vue b/web_src/src/components/dialog/channelMapInfobox.vue index 2ef0e529..83040680 100644 --- a/web_src/src/components/dialog/channelMapInfobox.vue +++ b/web_src/src/components/dialog/channelMapInfobox.vue @@ -44,7 +44,7 @@ export default { let that = this; this.$axios({ method: 'get', - url: '/api/play/start/' + deviceId + '/' + channelId + url: './api/play/start/' + deviceId + '/' + channelId }).then(function (res) { that.isLoging = false; if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/chooseChannel.vue b/web_src/src/components/dialog/chooseChannel.vue index e0e79c3a..e8918391 100644 --- a/web_src/src/components/dialog/chooseChannel.vue +++ b/web_src/src/components/dialog/chooseChannel.vue @@ -98,7 +98,7 @@ export default { this.$axios({ method:"post", - url:"/api/platform/update_channel_for_gb", + url:"./api/platform/update_channel_for_gb", data:{ platformId: that.platformId, channelReduces: that.chooseData diff --git a/web_src/src/components/dialog/chooseChannelForCatalog.vue b/web_src/src/components/dialog/chooseChannelForCatalog.vue index c634b77d..82d1f58e 100644 --- a/web_src/src/components/dialog/chooseChannelForCatalog.vue +++ b/web_src/src/components/dialog/chooseChannelForCatalog.vue @@ -82,7 +82,7 @@ export default { let that = this; this.$axios({ method:"get", - url:`/api/platform/catalog`, + url:`./api/platform/catalog`, params: { platformId: that.platformId, parentId: parentId @@ -134,7 +134,7 @@ export default { removeCatalog: function (id, node){ this.$axios({ method:"delete", - url:`/api/platform/catalog/del`, + url:`./api/platform/catalog/del`, params: { id: id, platformId: this.platformId, @@ -156,7 +156,7 @@ export default { setDefaultCatalog: function (id){ this.$axios({ method:"post", - url:`/api/platform/catalog/default/update`, + url:`./api/platform/catalog/default/update`, params: { platformId: this.platformId, catalogId: id, @@ -201,7 +201,7 @@ export default { onClick: () => { this.$axios({ method:"delete", - url:"/api/platform/catalog/relation/del", + url:"./api/platform/catalog/relation/del", data: data }).then((res)=>{ console.log("移除成功") diff --git a/web_src/src/components/dialog/chooseChannelForGb.vue b/web_src/src/components/dialog/chooseChannelForGb.vue index fc97b4ce..270bcdaf 100644 --- a/web_src/src/components/dialog/chooseChannelForGb.vue +++ b/web_src/src/components/dialog/chooseChannelForGb.vue @@ -121,7 +121,7 @@ export default { this.getCatalogFromUser((catalogId)=> { this.$axios({ method:"post", - url:"/api/platform/update_channel_for_gb", + url:"./api/platform/update_channel_for_gb", data:{ platformId: this.platformId, all: all, @@ -149,7 +149,7 @@ export default { this.$axios({ method:"delete", - url:"/api/platform/del_channel_for_gb", + url:"./api/platform/del_channel_for_gb", data:{ platformId: this.platformId, all: all, @@ -248,7 +248,7 @@ export default { this.$axios({ method:"get", - url:`/api/platform/channel_list`, + url:`./api/platform/channel_list`, params: { page: that.currentPage, count: that.count, @@ -290,7 +290,7 @@ export default { }).then(() => { this.$axios({ method:"delete", - url:"/api/platform/del_channel_for_gb", + url:"./api/platform/del_channel_for_gb", data:{ platformId: this.platformId, channelReduces: this.multipleSelection @@ -310,7 +310,7 @@ export default { this.$axios({ method: "post", - url: "/api/platform/update_channel_for_gb", + url: "./api/platform/update_channel_for_gb", data: { platformId: this.platformId, channelReduces: this.multipleSelection, diff --git a/web_src/src/components/dialog/chooseChannelForStream.vue b/web_src/src/components/dialog/chooseChannelForStream.vue index 6c4653b5..fbf31338 100644 --- a/web_src/src/components/dialog/chooseChannelForStream.vue +++ b/web_src/src/components/dialog/chooseChannelForStream.vue @@ -134,7 +134,7 @@ export default { this.getCatalogFromUser((catalogId)=>{ this.$axios({ method:"post", - url:"/api/gbStream/add", + url:"./api/gbStream/add", data:{ platformId: this.platformId, catalogId: catalogId, @@ -163,7 +163,7 @@ export default { this.$axios({ method:"delete", - url:"/api/gbStream/del", + url:"./api/gbStream/del", data:{ platformId: this.platformId, all: all, @@ -186,7 +186,7 @@ export default { this.$axios({ method: 'get', - url:`/api/gbStream/list`, + url:`./api/gbStream/list`, params: { page: that.currentPage, count: that.count, @@ -222,7 +222,7 @@ export default { }).then(() => { this.$axios({ method:"delete", - url:"/api/gbStream/del", + url:"./api/gbStream/del", data:{ platformId: this.platformId, gbStreams: this.multipleSelection, @@ -242,7 +242,7 @@ export default { this.getCatalogFromUser((catalogId)=>{ this.$axios({ method:"post", - url:"/api/gbStream/add", + url:"./api/gbStream/add", data:{ platformId: this.platformId, catalogId: catalogId, diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue index 8a5f9d13..9cacc362 100644 --- a/web_src/src/components/dialog/deviceEdit.vue +++ b/web_src/src/components/dialog/deviceEdit.vue @@ -131,7 +131,7 @@ export default { this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0 this.$axios({ method: 'post', - url:`/api/device/query/device/${this.isEdit?'update':'add'}/`, + url:`./api/device/query/device/${this.isEdit?'update':'add'}/`, params: this.form }).then((res) => { console.log(res.data) diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue index e83a29c5..c7fde47d 100644 --- a/web_src/src/components/dialog/devicePlayer.vue +++ b/web_src/src/components/dialog/devicePlayer.vue @@ -320,7 +320,7 @@ export default { if (tab.name === "codec") { this.$axios({ method: 'get', - url: '/zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId + url: './zlm/' +this.mediaServerId+ '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app='+ this.app +'&stream='+ this.streamId }).then(function (res) { that.tracksLoading = false; if (res.data.code == 0 && res.data.tracks) { @@ -397,7 +397,7 @@ export default { this.$refs[this.activePlayer].pause() that.$axios({ method: 'post', - url: '/api/play/convert/' + that.streamId + url: './api/play/convert/' + that.streamId }).then(function (res) { if (res.data.code === 0) { that.convertKey = res.data.key; @@ -434,7 +434,7 @@ export default { that.$refs.videoPlayer.pause() this.$axios({ method: 'post', - url: '/api/play/convertStop/' + this.convertKey + url: './api/play/convertStop/' + this.convertKey }).then(function (res) { if (res.data.code == 0) { console.log(res.data.msg) @@ -494,7 +494,7 @@ export default { let that = this; this.$axios({ method: 'post', - url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed + url: './api/ptz/control/' + this.deviceId + '/' + this.channelId + '?command=' + command + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed }).then(function (res) {}); }, //////////////////////播放器事件处理////////////////////////// @@ -506,7 +506,7 @@ export default { let that = this; this.$axios({ method: 'post', - url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0' + url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0' }).then(function (res) {}); }, setSpeedOrTime: function (cmdCode, groupNum, parameter) { @@ -516,7 +516,7 @@ export default { console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); this.$axios({ method: 'post', - url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2 + url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2 }).then(function (res) {}); }, setCommand: function (cmdCode, groupNum, parameter) { @@ -524,7 +524,7 @@ export default { console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); this.$axios({ method: 'post', - url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0' + url: './api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0' }).then(function (res) {}); }, copyUrl: function (dropdownItem){ diff --git a/web_src/src/components/dialog/getCatalog.vue b/web_src/src/components/dialog/getCatalog.vue index fdc26de1..3aae99d3 100644 --- a/web_src/src/components/dialog/getCatalog.vue +++ b/web_src/src/components/dialog/getCatalog.vue @@ -89,7 +89,7 @@ export default { let that = this; this.$axios({ method:"get", - url:`/api/platform/catalog`, + url:`./api/platform/catalog`, params: { platformId: that.platformId, parentId: parentId @@ -111,7 +111,7 @@ export default { if (node.level === 0) { this.$axios({ method:"get", - url:`/api/platform/info/` + this.platformId, + url:`./api/platform/info/` + this.platformId, }) .then((res)=> { if (res.data.code === 0) { diff --git a/web_src/src/components/dialog/importChannel.vue b/web_src/src/components/dialog/importChannel.vue index 91611e80..d511fe8b 100644 --- a/web_src/src/components/dialog/importChannel.vue +++ b/web_src/src/components/dialog/importChannel.vue @@ -60,7 +60,7 @@ export default { console.log(this.form); this.$axios({ method:"post", - url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, + url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, data: this.form }) .then((res)=> { diff --git a/web_src/src/components/dialog/onvifEdit.vue b/web_src/src/components/dialog/onvifEdit.vue index 17eabb39..8a68b20f 100644 --- a/web_src/src/components/dialog/onvifEdit.vue +++ b/web_src/src/components/dialog/onvifEdit.vue @@ -81,7 +81,7 @@ export default { console.log(this.form); this.$axios({ method: 'get', - url:`api/onvif/rtsp`, + url:`./api/onvif/rtsp`, params: { hostname: this.form.hostName, timeout: 3000, diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 76382324..a6ced30f 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -138,7 +138,7 @@ export default { showDialog: false, isLoging: false, onSubmit_text: "立即创建", - saveUrl: "/api/platform/save", + saveUrl: "./api/platform/save", platform: { id: null, @@ -192,7 +192,7 @@ export default { this.saveUrl = "/api/platform/add"; this.$axios({ method: 'get', - url:`/api/platform/server_config` + url:`./api/platform/server_config` }).then(function (res) { console.log(res); if (res.data.code === 0) { @@ -315,7 +315,7 @@ export default { var that = this; await that.$axios({ method: 'get', - url:`/api/platform/exit/${deviceGbId}`}) + url:`./api/platform/exit/${deviceGbId}`}) .then(function (res) { if (res.data.code === 0) { result = res.data.data; diff --git a/web_src/src/components/dialog/pushStreamEdit.vue b/web_src/src/components/dialog/pushStreamEdit.vue index de4e7bcc..2e632b5e 100644 --- a/web_src/src/components/dialog/pushStreamEdit.vue +++ b/web_src/src/components/dialog/pushStreamEdit.vue @@ -109,7 +109,7 @@ export default { if (this.edit) { this.$axios({ method:"post", - url:`/api/push/save_to_gb`, + url:`./api/push/save_to_gb`, data: this.proxyParam }).then( (res) => { if (res.data.code === 0) { @@ -129,7 +129,7 @@ export default { }else { this.$axios({ method:"post", - url:`/api/push/add`, + url:`./api/push/add`, data: this.proxyParam }).then( (res) => { if (res.data.code === 0) { @@ -159,7 +159,7 @@ export default { var that = this; await that.$axios({ method:"get", - url:`/api/platform/exit/${deviceGbId}` + url:`./api/platform/exit/${deviceGbId}` }).then(function (res) { result = res.data; }).catch(function (error) { diff --git a/web_src/src/components/dialog/queryTrace.vue b/web_src/src/components/dialog/queryTrace.vue index 5063ad4e..fcd1c107 100644 --- a/web_src/src/components/dialog/queryTrace.vue +++ b/web_src/src/components/dialog/queryTrace.vue @@ -72,7 +72,7 @@ export default { onSubmit: function () { console.log("onSubmit"); this.isLoging = true; - let url = `/api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`; + let url = `./api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`; if (this.channel.channelId) { url+="&channelId=${this.channel.channelId}" } diff --git a/web_src/src/components/dialog/recordDownload.vue b/web_src/src/components/dialog/recordDownload.vue index 3e8c4271..46774876 100644 --- a/web_src/src/components/dialog/recordDownload.vue +++ b/web_src/src/components/dialog/recordDownload.vue @@ -71,7 +71,7 @@ export default { getProgress: function (callback){ this.$axios({ method: 'get', - url: `/api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}` + url: `./api/gb_record/download/progress/${this.deviceId}/${this.channelId}/${this.stream}` }).then((res)=> { console.log(res) if (res.data.code === 0) { @@ -124,7 +124,7 @@ export default { stopDownloadRecord: function (callback) { this.$axios({ method: 'get', - url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream + url: './api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.stream }).then((res)=> { if (callback) callback(res) }); @@ -132,7 +132,7 @@ export default { getFileDownload: function (){ this.$axios({ method: 'get', - url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/add`, + url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/add`, params: { app: this.app, stream: this.stream, @@ -164,7 +164,7 @@ export default { getProgressForFile: function (callback){ this.$axios({ method: 'get', - url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/list`, + url:`./record_proxy/${this.mediaServerId}/api/record/file/download/task/list`, params: { app: this.app, stream: this.stream, diff --git a/web_src/src/components/live.vue b/web_src/src/components/live.vue index 4a7af491..a6914185 100644 --- a/web_src/src/components/live.vue +++ b/web_src/src/components/live.vue @@ -135,7 +135,7 @@ export default { this.loading = true this.$axios({ method: 'get', - url: '/api/play/start/' + deviceId + '/' + channelId + url: './api/play/start/' + deviceId + '/' + channelId }).then(function (res) { if (res.data.code === 0 && res.data.data) { let videoUrl; diff --git a/web_src/src/components/map.vue b/web_src/src/components/map.vue index 2aa17f63..20adff0e 100644 --- a/web_src/src/components/map.vue +++ b/web_src/src/components/map.vue @@ -298,7 +298,7 @@ export default { let that = this; this.$axios({ method: 'get', - url: '/api/play/start/' + deviceId + '/' + channelId + url: './api/play/start/' + deviceId + '/' + channelId }).then(function (res) { that.isLoging = false; if (res.data.code === 0) { diff --git a/web_src/src/components/service/DeviceService.js b/web_src/src/components/service/DeviceService.js index 85d36f8b..61314fe3 100644 --- a/web_src/src/components/service/DeviceService.js +++ b/web_src/src/components/service/DeviceService.js @@ -9,7 +9,7 @@ class DeviceService{ getDeviceList(currentPage, count, callback, errorCallback){ this.$axios({ method: 'get', - url:`/api/device/query/devices`, + url:`./api/device/query/devices`, params: { page: currentPage, count: count @@ -25,7 +25,7 @@ class DeviceService{ getDevice(deviceId, callback, errorCallback){ this.$axios({ method: 'get', - url:`/api/device/query/devices/${deviceId}`, + url:`./api/device/query/devices/${deviceId}`, }).then((res) => { if (typeof (callback) == "function") callback(res.data) }).catch((error) => { @@ -82,7 +82,7 @@ class DeviceService{ getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) { this.$axios({ method: 'get', - url: `/api/device/query/devices/${deviceId}/channels`, + url: `./api/device/query/devices/${deviceId}/channels`, params:{ page: currentPage, count: count, @@ -121,7 +121,7 @@ class DeviceService{ getSubChannel(isCatalog, deviceId, channelId, currentPage, count, callback, errorCallback) { this.$axios({ method: 'get', - url: `/api/device/query/sub_channels/${deviceId}/${channelId}/channels`, + url: `./api/device/query/sub_channels/${deviceId}/${channelId}/channels`, params:{ page: currentPage, count: count, @@ -161,7 +161,7 @@ class DeviceService{ } this.$axios({ method: 'get', - url: `/api/device/query/tree/${deviceId}`, + url: `./api/device/query/tree/${deviceId}`, params:{ page: currentPage, count: count, diff --git a/web_src/src/components/service/MediaServer.js b/web_src/src/components/service/MediaServer.js index d4446f06..a2f306ce 100644 --- a/web_src/src/components/service/MediaServer.js +++ b/web_src/src/components/service/MediaServer.js @@ -9,7 +9,7 @@ class MediaServer{ getOnlineMediaServerList(callback){ this.$axios({ method: 'get', - url:`/api/server/media_server/online/list`, + url:`./api/server/media_server/online/list`, }).then((res) => { if (typeof (callback) == "function") callback(res.data) }).catch((error) => { @@ -19,7 +19,7 @@ class MediaServer{ getMediaServerList(callback){ this.$axios({ method: 'get', - url:`/api/server/media_server/list`, + url:`./api/server/media_server/list`, }).then(function (res) { if (typeof (callback) == "function") callback(res.data) }).catch(function (error) { @@ -30,7 +30,7 @@ class MediaServer{ getMediaServer(id, callback){ this.$axios({ method: 'get', - url:`/api/server/media_server/one/` + id, + url:`./api/server/media_server/one/` + id, }).then(function (res) { if (typeof (callback) == "function") callback(res.data) }).catch(function (error) { @@ -41,7 +41,7 @@ class MediaServer{ checkServer(param, callback){ this.$axios({ method: 'get', - url:`/api/server/media_server/check`, + url:`./api/server/media_server/check`, params: { ip: param.ip, port: param.httpPort, @@ -57,7 +57,7 @@ class MediaServer{ checkRecordServer(param, callback){ this.$axios({ method: 'get', - url:`/api/server/media_server/record/check`, + url:`./api/server/media_server/record/check`, params: { ip: param.ip, port: param.recordAssistPort @@ -72,7 +72,7 @@ class MediaServer{ addServer(param, callback){ this.$axios({ method: 'post', - url:`/api/server/media_server/save`, + url:`./api/server/media_server/save`, data: param }).then(function (res) { if (typeof (callback) == "function") callback(res.data) @@ -84,7 +84,7 @@ class MediaServer{ delete(id, callback) { this.$axios({ method: 'delete', - url:`/api/server/media_server/delete`, + url:`./api/server/media_server/delete`, params: { id: id }