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