From 07edfcc5ce4501e31d8b65a8f77a55c5252b6059 Mon Sep 17 00:00:00 2001
From: yang <2319498928@qq.com>
Date: Tue, 27 Oct 2026 15:07:29 +0800
Subject: [PATCH] =?UTF-8?q?fix(=E8=AE=BE=E5=A4=87=E8=AF=A6=E6=83=85)?=
=?UTF-8?q?=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=AE=A4=E8=AF=81=E5=BC=B9=E7=AA=97?=
=?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vue/src/api/iot/device.js | 4 +--
vue/src/views/iot/device/device-edit.vue | 37 +++++++++++++++---------
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/vue/src/api/iot/device.js b/vue/src/api/iot/device.js
index b3dad975..8df5f26f 100644
--- a/vue/src/api/iot/device.js
+++ b/vue/src/api/iot/device.js
@@ -155,9 +155,9 @@ export function getMqttConnect(params) {
}
//获取国标配置信息
-export function getSipConfig(deviceSipId) {
+export function getSipConfig(deviceId) {
return request({
- url: '/sip/sipconfig/auth/' + deviceSipId,
+ url: '/sip/sipconfig/auth/' + deviceId,
method: 'get',
});
}
diff --git a/vue/src/views/iot/device/device-edit.vue b/vue/src/views/iot/device/device-edit.vue
index 597f1756..329fe5f1 100644
--- a/vue/src/views/iot/device/device-edit.vue
+++ b/vue/src/views/iot/device/device-edit.vue
@@ -285,8 +285,8 @@
-
+
@@ -361,6 +361,9 @@ export default {
},
},
computed: {
+ isSipTransport() {
+ return String(this.form.transport || '').toUpperCase() === 'GB28181' || Number(this.form.deviceType) === 3;
+ },
deviceStatus: {
set(val) {
if (val == 1) {
@@ -389,6 +392,7 @@ export default {
//二维码
openCode: false,
openViewMqtt: false,
+ showSipConfig: false,
// 生成设备编码是否禁用
genDisabled: false,
// 选中选项卡
@@ -1038,7 +1042,7 @@ export default {
this.httpForm.port +
'"}';
}
- if (this.form.transport == 'GB28181') {
+ if (this.isSipTransport || this.showSipConfig) {
input.value =
'{domainAlias:' +
this.GBform.domainAlias +
@@ -1101,6 +1105,7 @@ export default {
handleViewMqtt() {
this.openViewMqtt = true;
this.loading = true;
+ this.showSipConfig = false;
if (this.form.transport === 'MQTT' || this.form.transport === 'TCP' || this.form.transport === 'COAP') {
const params = {
deviceId: this.form.deviceId,
@@ -1108,16 +1113,9 @@ export default {
getMqttConnect(params).then((response) => {
if (response.code == 200) {
this.listQuery = response.data;
- this.loading = false;
- }
- });
- } else if (this.form.transport === 'GB28181') {
- const deviceSipId = this.form.deviceId;
- getSipConfig(deviceSipId).then((response) => {
- if (response.code == 200) {
- this.GBform = response.data;
- this.loading = false;
}
+ }).finally(() => {
+ this.loading = false;
});
} else if (this.form.transport === 'HTTP') {
const params = {
@@ -1126,8 +1124,21 @@ export default {
getHttpConfig(params).then((response) => {
if (response.code == 200) {
this.httpForm = response.data;
- this.loading = false;
}
+ }).finally(() => {
+ this.loading = false;
+ });
+ } else {
+ // Unknown or missing transport values fall back to SIP auth for this connection-info dialog.
+ this.showSipConfig = true;
+ getSipConfig(this.form.deviceId).then((response) => {
+ if (response.code == 200) {
+ this.GBform = response.data || {};
+ }
+ }).catch(() => {
+ this.$modal.msgError(this.$t('device.device-edit.148398-35'));
+ }).finally(() => {
+ this.loading = false;
});
}
},