This commit is contained in:
joylink_cuiweidong 2022-07-20 18:20:37 +08:00
commit 80408014fd

View File

@ -13,7 +13,7 @@
* onTimeout {Function} 超时后调用默认超时时间为60秒
*/
export function btts(param, options) {
var url = 'http://tsn.baidu.com/text2audio';
var url = process.env.NODE_ENV === 'development' ? 'http://tsn.baidu.com/text2audio' : 'https://tsn.baidu.com/text2audio';
var opt = options || {};
var p = param || {};
@ -49,7 +49,7 @@ export function btts(param, options) {
// 创建form参数
var data = {};
for (var p in param) {
data[p] = param[p]
data[p] = param[p];
}
// 赋值预定义参数
@ -90,7 +90,7 @@ export function btts(param, options) {
if (opt.autoDestory) {
audio.onended = function() {
document.body.removeChild(audio);
}
};
}
isFunction(opt.onSuccess) && opt.onSuccess(audio);
@ -106,7 +106,7 @@ export function btts(param, options) {
}
}
}
}
};
// 判断是否是函数
function isFunction(obj) {