lsc 1 周之前
父节点
当前提交
ebab09f34d
共有 1 个文件被更改,包括 27 次插入0 次删除
  1. 27 0
      pbl.js

+ 27 - 0
pbl.js

@@ -446,6 +446,33 @@ router.route("/updateFolder").all(async (req, res, next) => {
     }
     }
 });
 });
 
 
+
+//修改文件夹
+router.route("/updateFolder2").all(async (req, res, next) => {
+    //mode的处理
+    if (req.body[0]) {
+        try {
+            const { folderid, ...folderData } = req.body[0]; // 解构赋值,排除folderid
+            const response = await client.collections.update({
+                id: folderid,
+                name: decodeURIComponent(req.body[0].n),
+                description: decodeURIComponent(req.body[0].d)
+            });
+
+            p = Object.values(folderData); // 获取剩余属性的键
+
+            p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateFolder3");
+            mysql.usselect(p, async function (ret) {
+                res.end(JSON.stringify(ret));
+            });
+
+        } catch (error) {
+            res.status(500).json({ error: error instanceof Error ? error.message : "An error occurred" });
+        }
+
+    }
+});
+
 //移除文件
 //移除文件
 router.route("/removeFile").all(async (req, res, next) => {
 router.route("/removeFile").all(async (req, res, next) => {
     if (req.body[0]) {
     if (req.body[0]) {