|
@@ -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) => {
|
|
|
if (req.body[0]) {
|