lrf402788946 4 年之前
父節點
當前提交
ccfcdbc62c
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/controller/files.js

+ 3 - 2
app/controller/files.js

@@ -71,8 +71,6 @@ class FilesController extends Controller {
     assert(type, 'type不允许为空');
     const { ctx, app } = this;
     const url = app.config.wx.wxdown + serverid;
-    console.log(url);
-    console.log(type);
     const file = await this.ctx.curl(url);
     const stream = new wxstream.PassThrough();
     stream.end(file.data);
@@ -93,6 +91,9 @@ class FilesController extends Controller {
       const resultname = `${saved.id}`;
       console.log(`dir_path=>${dir_path}`);
       console.log(`resultname=>${resultname}`);
+      console.log(`p1=>${dir_path}${resultname}.amr`);
+      const isExist = await fs.existsSync(`${dir_path}${resultname}.amr`);
+      console.log(isExist);
       const data = await amrToMp3(`${dir_path}${resultname}.amr`, dir_path, resultname);
       console.log(data);
       // const ffurl = `${saved.filePath}${resultname}`;