From 16a2b64f101447de402a6e5d6e07d9b911e8ea0a Mon Sep 17 00:00:00 2001 From: Joe <1712833832@qq.com> Date: Thu, 18 Jan 2024 18:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DeviceControlDialog.vue | 16 ++++++++++---- .../RoadAndEvents/utils/httpList.js | 22 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue index 446f90bd..04a56389 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue @@ -22,9 +22,10 @@ import Form from '@screen/components/FormConfig'; import { cloneDeep } from "lodash" import { delay } from "@screen/utils/common.js" +import request from "@/utils/request"; import { Message } from "element-ui"; -import { axiosIns } from "@screen/utils/axios/auth.js"; +// import { axiosIns } from "@screen/utils/axios/auth.js"; const workStatus = [ { @@ -142,7 +143,10 @@ export default { handler(bool) { if (!bool) return; - axiosIns.post(`business/device/functions/${this.deviceId}/${51}`) + request({ + url: `business/device/functions/${this.deviceId}/${51}`, + method: "post", + }) .then(async (result) => { if (result.code != 200) return; @@ -197,10 +201,14 @@ export default { /** * 接口 地址 + * * https://www.showdoc.com.cn/2450725213006196/10877717880262686 */ - - axiosIns.post(`business/device/functions/${this.deviceId}/${functionId}`, result) + request({ + url: `business/device/functions/${this.deviceId}/${functionId}`, + method: "post", + params: result, + }) .then((result) => { if (result.code != 200) return Message.error(`设备操作失败!`); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js index e606a0f2..f12b7095 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js @@ -71,20 +71,28 @@ export function controlCamera(camId, cmdType) { * @returns */ export async function getRoadInfoByStakeMark(stakeMarkId) { - const stakeMarkInfo = await axiosIns.get( - `/business/stakeMark/${stakeMarkId}` - ); + const stakeMarkInfo = await request({ + url: `/business/stakeMark/${stakeMarkId}`, + method: "get", + // params + }); if (!stakeMarkInfo.data?.section_id) return {}; - const roadSectionInfo = await axiosIns.get( - `/business/roadSection/${stakeMarkInfo.data.section_id}` - ); + const roadSectionInfo = await request({ + url: `/business/roadSection/${stakeMarkInfo.data.section_id}`, + method: "get", + }); if (!roadSectionInfo.data?.road_id) return {}; return ( - (await axiosIns.get(`/business/road/${roadSectionInfo.road_id}`)).data || {} + ( + await request({ + url: `/business/road/${roadSectionInfo.road_id}`, + method: "get", + }) + ).data || {} ); }