ok.clearRecord(tempFilePath)

基础库1.4.2开始支持

清理当前小程序已录音的临时文件。

参数

参数名 类型 默认值 必填 说明
tempFilePath string 无 否 tempFilePath 不传时默认删除整个临时目录video下的录音文件,传时删除指定路径文件

接口返回值 Object res 的属性

属性名 类型 说明
code number 响应状态码
data object 成功响应结果
  result boolean 清理结果
msg string 响应信息

示例代码

ok.clearRecord({tempFilePath: '/xxxx/xxx/0/xxx/123.MP3'})
.then(res => {
console.log('删除临时录音成功', res.data.result);
})
.catch(err =>{
console.log("接口调用异常",err);
});
  1. 1. ok.clearRecord(tempFilePath)
    1. 1.1. 参数
    2. 1.2. 接口返回值 Object res 的属性
    3. 1.3. 示例代码