修改语音掉线
This commit is contained in:
+6
-4
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user