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

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

View File

@@ -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,

View File

@@ -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
}