mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-11-06 17:09:11 +08:00
fix(设备详情): 修复认证信息弹窗报错与空白
设备详情查询补充 transport 字段;国标设备走正确的 SIP 接口,其余设备恢复 展示连接信息;移除调用错误地址 /sip/sipconfig/auth 的旧接口。
This commit is contained in:
@@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceByDeviceId" parameterType="Long" resultMap="DeviceResult">
|
||||
select d.device_id, d.device_name, d.product_id, p.product_name,p.device_type, d.user_id, d.user_name, d.tenant_id, d.tenant_name,
|
||||
select d.device_id, d.device_name, d.product_id, p.product_name,p.device_type,p.transport, d.user_id, d.user_name, d.tenant_id, d.tenant_name,
|
||||
d.serial_number, d.firmware_version, d.status, d.rssi,d.is_shadow,d.is_simulate ,d.location_way,d.things_model_value,
|
||||
d.network_address, d.network_ip, d.longitude, d.latitude, d.active_time, d.create_time, d.update_time,
|
||||
d.img_url,d.summary,d.remark from iot_device d
|
||||
|
||||
@@ -153,11 +153,3 @@ export function getMqttConnect(params) {
|
||||
params: params,
|
||||
});
|
||||
}
|
||||
|
||||
//获取国标配置信息
|
||||
export function getSipConfig(deviceId) {
|
||||
return request({
|
||||
url: '/sip/sipconfig/auth/' + deviceId,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -326,7 +326,8 @@ import deviceTimer from './device-timer';
|
||||
import DeviceFunc from './device-functionlog';
|
||||
import vueQr from 'vue-qr';
|
||||
import { loadBMap } from '@/utils/map.js';
|
||||
import { deviceSynchronization, getDevice, addDevice, updateDevice, generatorDeviceNum, getMqttConnect, getSipConfig } from '@/api/iot/device';
|
||||
import { deviceSynchronization, getDevice, addDevice, updateDevice, generatorDeviceNum, getMqttConnect } from '@/api/iot/device';
|
||||
import { getSipconfig } from '@/api/iot/sipConfig';
|
||||
import { getDeviceRunningStatus } from '@/api/iot/device';
|
||||
import { cacheJsonThingsModel } from '@/api/iot/model';
|
||||
import deviceLiveStream from '@/views/components/player/deviceLiveStream';
|
||||
@@ -978,6 +979,7 @@ export default {
|
||||
this.form.productId = product.productId;
|
||||
this.form.productName = product.productName;
|
||||
this.form.deviceType = product.deviceType;
|
||||
this.form.transport = product.transport;
|
||||
this.form.tenantId = product.tenantId;
|
||||
this.form.tenantName = product.tenantName;
|
||||
if (product.transport === 'TCP') {
|
||||
@@ -1106,7 +1108,20 @@ export default {
|
||||
this.openViewMqtt = true;
|
||||
this.loading = true;
|
||||
this.showSipConfig = false;
|
||||
if (this.form.transport === 'MQTT' || this.form.transport === 'TCP' || this.form.transport === 'COAP') {
|
||||
if (this.isSipTransport) {
|
||||
// 国标(GB28181)设备展示 SIP 系统配置
|
||||
this.showSipConfig = true;
|
||||
getSipconfig(this.form.productId, false).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;
|
||||
});
|
||||
} else {
|
||||
// MQTT / TCP / COAP / HTTP 等设备展示连接信息
|
||||
const params = {
|
||||
deviceId: this.form.deviceId,
|
||||
};
|
||||
@@ -1117,29 +1132,6 @@ export default {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else if (this.form.transport === 'HTTP') {
|
||||
const params = {
|
||||
deviceId: this.form.deviceId,
|
||||
};
|
||||
getHttpConfig(params).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.httpForm = response.data;
|
||||
}
|
||||
}).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;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user