浏览代码

fix: upload hierarchy error

Nick 6 年之前
父节点
当前提交
eedd1c0707
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      server/controllers/upload.js

+ 1 - 1
server/controllers/upload.js

@@ -74,7 +74,7 @@ router.post('/u', multer({
   }
 
   // Check if user can upload at path
-  const assetPath = (folderId) ? opts.hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
+  const assetPath = (folderId) ? hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
   if (!WIKI.auth.checkAccess(req.user, ['write:assets'], { path: assetPath })) {
     return res.status(403).json({
       succeeded: false,