Commit 22c0b1ab authored by liujiangnan's avatar liujiangnan

feat: 录音异常处理

parent 6c3df56c
......@@ -152,6 +152,14 @@ export function initAir(_this) {
window.air.testCallBack = (res) => {
res = typeof(res) == 'string' ? res : JSON.stringify(res);
_this.log(`===成功调用testCallBack=== res == ${res}`);
// 录音异常兼容处理
const resObj = JSON.parse(res);
if (resObj.errCode) {
resObj.result = {overall:0};
resObj.audioUrl = "";
res = JSON.stringify(resObj);
_this.showTips(`评测服务信号弱,可能会造成评分不准确,请稍后再来录音评测吧~`);
}
callback && callback(res);
window.air.testCallBack = null;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment