mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
设备状态 API 失败回调引用修复
getDeviceStatus 的 .fail() 块把函数体内 callback(res) 改成与签名一致的 if (failCallback) failCallback(err),避免业务错误时抛 ReferenceError。
This commit is contained in:
parent
e6585cfbd9
commit
5b7ae0cd17
1 changed files with 3 additions and 1 deletions
|
|
@ -127,7 +127,9 @@ export default {
|
||||||
})
|
})
|
||||||
.fail((err) => {
|
.fail((err) => {
|
||||||
RequestService.clearRequestTime();
|
RequestService.clearRequestTime();
|
||||||
callback(res);
|
if (failCallback) {
|
||||||
|
failCallback(err);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.networkFail((err) => {
|
.networkFail((err) => {
|
||||||
console.error('获取设备状态失败:', err);
|
console.error('获取设备状态失败:', err);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue