修复100J语音传输问题

This commit is contained in:
微微一笑
2026-04-01 10:17:40 +08:00
parent 64216eaa75
commit 0c54f550b9

View File

@ -1058,6 +1058,9 @@ export function deviceUpdateVoice(data) {
const hasLocalPath = effectiveLocal.length > 0 || hasBleCache;
const remoteUrl = isHttpUrlString(fu) ? fu : (isHttpUrlString(lp) ? lp : '');
const fileSource = hasLocalPath ? (effectiveLocal || BLE_CACHE_SENTINEL) : (remoteUrl || null);
// 仅「没有任何云端 URL、只能靠本机路径/缓存发二进制」时禁止 4G 兜底。
// 若列表项带 https即使用户曾下发过而残留 put100JVoiceBleCache仍应允许走 4G设备按 id 拉 OSS否则会误报「本地语音需通过蓝牙下发」。
const no4GFallback = !remoteUrl && hasLocalPath;
if (!fileSource) {
console.log('[100J] 语音上传:无 fileUrl/localPath仅 HTTP updateVoice不会走蓝牙传文件');
return httpExec(0).then((res) => { if (res && typeof res === 'object') res._channel = '4g'; return res; });
@ -1083,8 +1086,8 @@ export function deviceUpdateVoice(data) {
})
);
const http4g = () => httpExec(0);
// 本地文件:禁止一切 4G 兜底(含蓝牙未开时),避免仅传 id 假成功
return execWithBleFirst(bleExec, http4g, '语音文件上传', data.onWaiting, { no4GFallback: hasLocalPath });
// 无云端 URL 的纯本地文件:禁止 4G 兜底,避免仅传 id 假成功;有 https 时蓝牙失败可 4G
return execWithBleFirst(bleExec, http4g, '语音文件上传', data.onWaiting, { no4GFallback });
}
// 100J信息
export function deviceDetail(id) {