Ver código fonte

refactor: Remove unnecessary 'password==null" condition

chezhuang 1 ano atrás
pai
commit
8a613513aa

+ 2 - 2
server/src/main/java/cn/keking/web/controller/FileController.java

@@ -73,12 +73,12 @@ public class FileController {
             } catch (Exception e) {
                 sessionCode = "null";
             }
-            if (password==null || !sessionCode.equalsIgnoreCase(password)){
+            if (!sessionCode.equalsIgnoreCase(password)){
                 logger.error("删除文件【{}】失败,密码错误!",fileName);
                 return ReturnResponse.failure("删除文件失败,密码错误!");
             }
         }else {
-            if(password==null || !ConfigConstants.getPassword().equalsIgnoreCase(password)) {
+            if(!ConfigConstants.getPassword().equalsIgnoreCase(password)) {
                 logger.error("删除文件【{}】失败,密码错误!",fileName);
                 return ReturnResponse.failure("删除文件失败,密码错误!");
             }