Commit 99f31676 authored by liujiangnan's avatar liujiangnan

feat: 录音异常处理

parent e74e393e
...@@ -29,6 +29,14 @@ export default class NewClass extends middleLayerBase { ...@@ -29,6 +29,14 @@ export default class NewClass extends middleLayerBase {
(<any>window).air.testCallBack = (res) => { (<any>window).air.testCallBack = (res) => {
res = typeof (res) == 'string' ? res : JSON.stringify(res); res = typeof (res) == 'string' ? res : JSON.stringify(res);
console.log(`===成功调用testCallBack=== res == ${res}`); console.log(`===成功调用testCallBack=== res == ${res}`);
// 录音异常兼容处理
const resObj = JSON.parse(res);
if (resObj.errCode) {
resObj.result = {overall:0};
resObj.audioUrl = "";
res = JSON.stringify(resObj);
this.showTips(`评测服务信号弱,可能会造成评分不准确,请稍后再来录音评测吧~`);
}
this.saveRecordResult(res); this.saveRecordResult(res);
callback && callback(res); callback && callback(res);
(<any>window).air.testCallBack = null; (<any>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