修改语音掉线

This commit is contained in:
田岩
2025-09-17 22:30:31 +08:00
parent 1f27e0ebf5
commit 0d708632ea
6 changed files with 44 additions and 23 deletions
+6 -4
View File
@@ -86,22 +86,24 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey = 'voice') =
filePath: file,
name: fileKey,
formData: data,
timeout: 6000,
success(result) {
try {
const res = JSON.parse(result.data);
if (res.rtnCode === '0000') {
resolve(result);
return resolve(result);
} else if (REQUES_ERROR_CODES['NO_LOGIN'].includes(res.rtnCode)) {
goto_login_fun()
} else {
reject(new Error(res.message));
return reject('NO_LOGIN');
}
return reject('Other');
} catch (error) {
reject(new Error('Failed to parse response'));
}
},
fail(error) {
reject(new Error('Upload failed'));
console.log('err', error);
return reject('Other');
}
});
});