From cc1a8bfc79dd5f746791654937cb5c052e6da4e5 Mon Sep 17 00:00:00 2001
From: 10396 <1039655633@qq.com>
Date: Fri, 26 Sep 2025 10:18:43 +0800
Subject: [PATCH] =?UTF-8?q?```=20feat(api):=20=E6=B7=BB=E5=8A=A0=E8=AF=B7?=
=?UTF-8?q?=E6=B1=82=E5=8A=A0=E5=AF=86=E6=96=B9=E5=BC=8F=E8=AF=B4=E6=98=8E?=
=?UTF-8?q?=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 tabsList 中新增“请求加密方式”菜单项及其子项“POST请求加密方式”
- 调整后续 tab 项的 index,确保编号连续递增- 在 contentList 中添加详细的请求加密方式说明,包括: - 请求大小限制 - 请求头信息配置(X-app-Id、Content-Type) - 请求体 AES 加密与 Base64 编码方式 - 加密示例代码(Java)
- 更新所有 contentList项的 parentIndex,以匹配 tabsList 的新索引结构
```
---
src/views/api/index.vue | 264 ++++++++++++++++++++--------------------
1 file changed, 132 insertions(+), 132 deletions(-)
diff --git a/src/views/api/index.vue b/src/views/api/index.vue
index fc134c3..1f99035 100644
--- a/src/views/api/index.vue
+++ b/src/views/api/index.vue
@@ -168,6 +168,16 @@ const childrenIndex = ref(1);
const tabsList = ref([
{
index: 1,
+ name: "请求加密方式",
+ children: [
+ {
+ index: 1,
+ name: "POST请求加密方式",
+ },
+ ],
+ },
+ {
+ index: 2,
name: "双控信息数据",
children: [
{
@@ -231,7 +241,7 @@ const tabsList = ref([
],
},
{
- index: 2,
+ index: 3,
name: "道闸出入",
children: [
{
@@ -245,7 +255,7 @@ const tabsList = ref([
],
},
{
- index: 3,
+ index: 4,
name: "雷电预警",
children: [
{
@@ -263,7 +273,7 @@ const tabsList = ref([
],
},
{
- index: 4,
+ index: 5,
name: "人员信息",
children: [
{
@@ -297,7 +307,7 @@ const tabsList = ref([
],
},
{
- index: 5,
+ index: 6,
name: "特殊作业",
children: [
{
@@ -327,7 +337,7 @@ const tabsList = ref([
],
},
{
- index: 6,
+ index: 7,
name: "作业票",
children: [
{
@@ -389,7 +399,7 @@ const tabsList = ref([
],
},
{
- index: 7,
+ index: 8,
name: "综合管理",
children: [
{
@@ -410,21 +420,78 @@ const tabsList = ref([
},
],
},
- {
- index: 8,
- name: "请求加密方式",
- children: [
- {
- index: 1,
- name: "POST请求加密方式",
- },
- ],
- }
]);
const contentList = ref([
{
parentIndex: 1,
childrenIndex: 1,
+ title: "请求加密方式",
+ isHTML: true,
+ htmlStr: `
+
+
1.1、请求大小限制
+
+ 请求数据是list格式,但是为了请求效率,每次上报的请求数据在100条。
+ 对于特殊作业附件、视频智能分析附件上报接口,请求体大小要在 1M 内, 其他上报接口请求体的大小要在 15M 以内
+
+
+
+
1.2、请求头信息
+
+ 请求header中添加X-app-Id
+ 示例:X-app-Id : d2VpaHVhOjE1MzI0ODk3NTI0NTE5ODc0Ng==
+ 加密方式:将“服务平台编码:统一社会信用代码”字符串进行base64加密,服务平台编码和统一社会信用代码是在服务平台申请时填入
+ 请求头Content-Type : application/json
+
+
+
+
1.3、请求体加密
+
+ 请求体采用AES 加密方式,AES 加密需申请secretKey, 新申请接入的服务平台可申请。
+ 请求时,将请求信息转成json,先用AES 加密,再用Base64 对请求体的data 内容进行加密,最终效果为[{"data":"加密字符串"}]。
+
+
+
+
1.4、请求方式
+
+ 本文档中全部采用post请求方式
+
+
+
+
1.5、请求是否必填
+
+ 接口请求字段是否必填,依赖于推送的各个上游平台是否必填,在对接时可全部填写,可适配其他上游平台。
+ 每个上游平台字段是否必填,是通过平台配置,如果缺少必填字段项,在接口上报时会有异常返回提示。每个接口中的数据主键为必填项。
+
+
+
+
1.6、加密示例:
+
+
+ private static final String ALGORITHM = "AES";
+ private static final String TRANSFORMATION = "AES/ECB/PKCS5Padding";
+
+ public static String encrypt(String plainText, String base64Key) {
+ try {
+ byte[] decodedKey = Base64.getDecoder().decode(base64Key);
+ SecretKeySpec secretKey = new SecretKeySpec(decodedKey, ALGORITHM);
+
+ Cipher cipher = Cipher.getInstance(TRANSFORMATION);
+ cipher.init(Cipher.ENCRYPT_MODE, secretKey);
+
+ byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
+ return Base64.getEncoder().encodeToString(encryptedBytes);
+ } catch (Exception e) {
+ throw new RuntimeException("AES encryption failed", e);
+ }
+ }
+
+
+ `,
+ },
+ {
+ parentIndex: 2,
+ childrenIndex: 1,
title: "上报安全风险分析单元数据",
url: "/docking/data/v1/pushRiskUnitData",
requestBodyParameters: [
@@ -797,7 +864,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 2,
title: "上报安全风险事件数据",
url: "/docking/data/v1/pushRiskEventsData",
@@ -987,7 +1054,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 3,
title: "上报安全风险管控措施数据",
url: "/docking/data/v1/pushRiskControlMeasureData",
@@ -1301,7 +1368,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 4,
title: "上报风险事件辨识信息数据",
url: "/docking/data/v1/pushRiskIdentificationData",
@@ -1663,7 +1730,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 5,
title: "上报隐患排查任务数据",
url: "/docking/data/v1/pushHiddenCheckMissionData",
@@ -2148,7 +2215,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 6,
title: "上报隐患排查记录",
url: "/docking/data/v1/pushDangerCheckRecordData",
@@ -2623,7 +2690,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 7,
title: "上报隐患信息",
url: "/docking/data/v1/pushDangerInfoData",
@@ -3205,7 +3272,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 8,
title: "上报隐患排查清单",
url: "/docking/data/v1/pushHiddenDangerPlanData",
@@ -3620,7 +3687,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 9,
title: "上报安全承诺数据",
url: "/docking/data/v1/pushProductionPromiseData",
@@ -4075,7 +4142,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 10,
title: "上报承诺装置运行状态",
url: "/docking/data/v1/pushDeviceRunStatusData",
@@ -4313,7 +4380,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 11,
title: "上报安全风险分析对象数据",
url: "/docking/data/v1/pushRiskObjectData",
@@ -4469,7 +4536,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 12,
title: "上报专项检查隐患信息记录",
url: "/docking/data/v1/pushRiskObjectData",
@@ -4689,7 +4756,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 13,
title: "上报专项检查情况记录",
url: "/docking/data/v1/pushCheckRecordData",
@@ -4867,7 +4934,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 1,
+ parentIndex: 2,
childrenIndex: 14,
title: "新增包保责任人履职概览统计信息",
url: "/docking/data/v1/pushPerformanceOverview",
@@ -5131,7 +5198,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 2,
+ parentIndex: 3,
childrenIndex: 1,
title: "上报卡口车辆通行记录",
url: "/docking/data/v1/pushCarRecordData",
@@ -5397,7 +5464,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 2,
+ parentIndex: 3,
childrenIndex: 2,
title: "上报卡口人员通行记录",
url: "/docking/data/v1/pushPersonRecordData",
@@ -5612,7 +5679,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 3,
+ parentIndex: 4,
childrenIndex: 1,
title: "上报雷电预警设备基础数据",
url: "/docking/data/v1/pushEquipDataReceivingData",
@@ -5769,7 +5836,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 3,
+ parentIndex: 4,
childrenIndex: 2,
title: "上报雷电预警预警数据",
url: "/docking/data/v1/pushPushDataReceivingData",
@@ -5943,7 +6010,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 3,
+ parentIndex: 4,
childrenIndex: 3,
title: "上报雷电预警环境数据",
url: "/docking/data/v1/pushEnvironmentReceivingData",
@@ -6181,7 +6248,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 1,
title: "上报人员基础数据",
url: "/docking/data/v1/pushEmployeeInfoData",
@@ -6794,7 +6861,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 2,
title: "人员证件信息",
url: "/docking/data/v1/pushEmployeeLicenseData",
@@ -7015,7 +7082,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 3,
title: "人员实时定位数据",
url: "/docking/data/v1/pushEmployeeLocationData",
@@ -7235,7 +7302,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 4,
title: "人员报警数据",
url: "/docking/data/v1/pushEmployeeAlarmData",
@@ -7604,7 +7671,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 5,
title: "上报区域边界数据",
url: "/docking/data/v1/pushZoneInfoData",
@@ -7782,7 +7849,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 6,
title: "上报人员聚集数据",
url: "/docking/data/v1/pushEmployeeGatherData",
@@ -8005,7 +8072,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 4,
+ parentIndex: 5,
childrenIndex: 7,
title: "上报区域报警数据",
url: "/docking/data/v1/pushZoneAlarmData",
@@ -8181,7 +8248,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 5,
+ parentIndex: 6,
childrenIndex: 1,
title: "上报特殊作业审批记录",
url: "/docking/data/v1/pushWorkApprovalData",
@@ -8475,7 +8542,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 5,
+ parentIndex: 6,
childrenIndex: 2,
title: "上报特殊作业安全措施记录",
url: "/docking/data/v1/pushWorkSafetyData",
@@ -8672,7 +8739,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 5,
+ parentIndex: 6,
childrenIndex: 3,
title: "上报特殊作业气体分析数据",
url: "/docking/data/v1/pushWorkGasAnalysisData",
@@ -9072,7 +9139,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 5,
+ parentIndex: 6,
childrenIndex: 4,
title: "上报特殊作业验收信息",
url: "/docking/data/v1/pushWorkCheckAcceptData",
@@ -9228,7 +9295,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 5,
+ parentIndex: 6,
childrenIndex: 5,
title: "上报特殊作业和视频关联数据",
url: "/docking/data/v1/pushWorkVideoData",
@@ -9359,7 +9426,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 5,
+ parentIndex: 6,
childrenIndex: 6,
title: "上报特殊作业附件数据",
url: "/docking/data/v1/pushWorkFileData",
@@ -9507,7 +9574,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 1,
title: "上报作业活动信息",
url: "/docking/data/v1/pushWorkJobData",
@@ -11134,7 +11201,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 2,
title: "上报动火作业票信息",
url: "/docking/data/v1/pushWorkHotData",
@@ -13060,7 +13127,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 3,
title: "上报受限空间作业票信息",
url: "/docking/data/v1/pushWorkSpaceData",
@@ -14672,7 +14739,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 4,
title: "上报盲板抽堵作业票信息",
url: "/docking/data/v1/pushWorkBlindplateData",
@@ -16249,7 +16316,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 5,
title: "上报高处作业票信息",
url: "/docking/data/v1/pushWorkHighData",
@@ -17814,7 +17881,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 6,
title: "上报吊装作业票信息",
url: "/docking/data/v1/pushWorkHoisingData",
@@ -19419,7 +19486,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 7,
title: "上报临时用电作业票信息",
url: "/docking/data/v1/pushWorkPowerData",
@@ -21179,7 +21246,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 8,
title: "上报动土作业票信息",
url: "/docking/data/v1/pushWorkGroundBreakData",
@@ -22675,7 +22742,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 9,
title: "上报断路作业票信息",
url: "/docking/data/v1/pushWorkBreakData",
@@ -24267,7 +24334,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 10,
title: "上报倒灌作业票信息",
url: "/docking/data/v1/pushWorkPouringData",
@@ -25792,7 +25859,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 11,
title: "上报清罐作业票信息",
url: "/docking/data/v1/pushWorkTankCleaningData",
@@ -27317,7 +27384,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 12,
title: "上报切水作业票信息",
url: "/docking/data/v1/pushWorkWaterData",
@@ -28843,7 +28910,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 13,
title: "上报检维修作业票信息",
url: "/docking/data/v1/pushWorkInspectionData",
@@ -30369,7 +30436,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 6,
+ parentIndex: 7,
childrenIndex: 14,
title: "上报承诺作业票详情",
url: "/docking/data/v1/pushPromiseTicketData",
@@ -30498,7 +30565,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 7,
+ parentIndex: 8,
childrenIndex: 1,
title: "开停车数据",
url: "/docking/data/v1/pushStartStopWorkData",
@@ -30722,7 +30789,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 7,
+ parentIndex: 8,
childrenIndex: 2,
title: "三同数据",
url: "/docking/data/v1/pushMeanwhileData",
@@ -31119,7 +31186,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 7,
+ parentIndex: 8,
childrenIndex: 3,
title: "大检修数据",
url: "/docking/data/v1/pushMaintenanceData",
@@ -31353,7 +31420,7 @@ const contentList = ref([
}`,
},
{
- parentIndex: 7,
+ parentIndex: 8,
childrenIndex: 4,
title: "停用/检修记录",
url: "/docking/data/v1/pushUnitStopData",
@@ -31509,73 +31576,6 @@ const contentList = ref([
}`,
},
- {
- parentIndex: 8,
- childrenIndex: 1,
- title: "请求加密方式",
- isHTML: true,
- htmlStr: `
-
-
1.1、请求大小限制
-
- 请求数据是list格式,但是为了请求效率,每次上报的请求数据在100条。
- 对于特殊作业附件、视频智能分析附件上报接口,请求体大小要在 1M 内, 其他上报接口请求体的大小要在 15M 以内
-
-
-
-
1.2、请求头信息
-
- 请求header中添加X-app-Id
- 示例:X-app-Id : d2VpaHVhOjE1MzI0ODk3NTI0NTE5ODc0Ng==
- 加密方式:将“服务平台编码:统一社会信用代码”字符串进行base64加密,服务平台编码和统一社会信用代码是在服务平台申请时填入
- 请求头Content-Type : application/json
-
-
-
-
1.3、请求体加密
-
- 请求体采用AES 加密方式,AES 加密需申请secretKey, 新申请接入的服务平台可申请。
- 请求时,将请求信息转成json,先用AES 加密,再用Base64 对请求体的data 内容进行加密,最终效果为[{"data":"加密字符串"}]。
-
-
-
-
1.4、请求方式
-
- 本文档中全部采用post请求方式
-
-
-
-
1.5、请求是否必填
-
- 接口请求字段是否必填,依赖于推送的各个上游平台是否必填,在对接时可全部填写,可适配其他上游平台。
- 每个上游平台字段是否必填,是通过平台配置,如果缺少必填字段项,在接口上报时会有异常返回提示。每个接口中的数据主键为必填项。
-
-
-
-
1.6、加密示例:
-
-
- private static final String ALGORITHM = "AES";
- private static final String TRANSFORMATION = "AES/ECB/PKCS5Padding";
-
- public static String encrypt(String plainText, String base64Key) {
- try {
- byte[] decodedKey = Base64.getDecoder().decode(base64Key);
- SecretKeySpec secretKey = new SecretKeySpec(decodedKey, ALGORITHM);
-
- Cipher cipher = Cipher.getInstance(TRANSFORMATION);
- cipher.init(Cipher.ENCRYPT_MODE, secretKey);
-
- byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
- return Base64.getEncoder().encodeToString(encryptedBytes);
- } catch (Exception e) {
- throw new RuntimeException("AES encryption failed", e);
- }
- }
-
-
- `,
- },
]);
const btnClick = (index, index1) => {
parentIndex.value = index;