asd123a20 3 years ago
parent
commit
16c3ea4570
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/service/files.js

+ 4 - 4
app/service/files.js

@@ -74,11 +74,11 @@ class FilesService extends Service {
       const index = filename.indexOf('.');
       const fileType = filename.slice(index, filename.length);
       const uuid = uuidv1();
-      // const filepath = `/filespath/${type === 'files' ? 'files' : 'resource'}/${uuid}${fileType}`;
-      // const paths = path.join(`${this.app.config.filespath}${filepath}`);
+      const filepath = `/filespath/${type === 'files' ? 'files' : 'resource'}/${uuid}${fileType}`;
+      const paths = path.join(`${this.app.config.filespath}${filepath}`);
 
-      const filepath = `/public/${type === 'files' ? 'files' : 'resource'}/${uuid}${fileType}`;
-      const paths = path.join(this.app.baseDir, `/app${filepath}`);
+      // const filepath = `/public/${type === 'files' ? 'files' : 'resource'}/${uuid}${fileType}`;
+      // const paths = path.join(this.app.baseDir, `/app${filepath}`);
       // 存储
       const result = await new Promise((resolve, reject) => {
         const remoteFileStream = fs.createWriteStream(paths);