Ver Fonte

fullrepeatcheck

AXCWG há 5 meses atrás
pai
commit
2380dedd46
1 ficheiros alterados com 17 adições e 1 exclusões
  1. 17 1
      main.js

+ 17 - 1
main.js

@@ -175,7 +175,23 @@ function SubmitWrapper(req, res) {
                   and kind = ${req.body.kind} `, (err, result) => {
 
         if (result.length === 0) {
-
+            let repeat = false;
+            currentTask.forEach((item) => {
+                if(req.body.name === item.name){
+                    if(req.body.albumName === item.albumName){
+                        if(req.body.kind === item.kind){
+                            repeat = true;
+                            res.header("Access-Control-Allow-Origin", "*");
+                            res.statusCode=500
+                            res.end("傻逼,重复了。请在盲目上传之前看看库里有没有好么傻逼?")
+
+                        }
+                    }
+                }
+            })
+            if(repeat){
+                return
+            }
             req_o = req;
             res_o = res;
             if (req.body.file !== undefined) {