lrf402788946 4 years ago
parent
commit
ccfcdbc62c
1 changed files with 3 additions and 2 deletions
  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}`;