From e1ce17a0d11ab40ae3645818233f335dc0e5442b Mon Sep 17 00:00:00 2001 From: xiaotao Date: Tue, 8 Jun 2021 22:34:03 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8DUNIQUE=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E5=85=AC=E5=85=B1=E7=BD=91=E7=9B=98=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=B9=9F=E4=BC=9A=E8=B7=B3=E8=BF=87=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=93=8D=E4=BD=9C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaotao/saltedfishcloud/service/file/StoreService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/xiaotao/saltedfishcloud/service/file/StoreService.java b/src/main/java/com/xiaotao/saltedfishcloud/service/file/StoreService.java index 2a2bbe43..66f83120 100644 --- a/src/main/java/com/xiaotao/saltedfishcloud/service/file/StoreService.java +++ b/src/main/java/com/xiaotao/saltedfishcloud/service/file/StoreService.java @@ -40,7 +40,7 @@ public class StoreService { * @param overwrite 是否覆盖,若非true,则跳过该文件 */ public void copy(int uid, String source, String target, int targetId, String sourceName, String targetName, Boolean overwrite) throws IOException { - if (DiskConfig.STORE_TYPE == StoreType.UNIQUE ) { + if ( uid != 0 && DiskConfig.STORE_TYPE == StoreType.UNIQUE ) { return ; } BasicFileInfo fileInfo = new BasicFileInfo(sourceName, null); @@ -135,7 +135,7 @@ public class StoreService { * @param overwrite 是否覆盖原文件 */ public void move(int uid, String source, String target, String name, boolean overwrite) throws IOException { - if (DiskConfig.STORE_TYPE == StoreType.UNIQUE) { + if (uid != 0 && DiskConfig.STORE_TYPE == StoreType.UNIQUE) { return; } PathHandler pathHandler = DiskConfig.getPathHandler(); @@ -170,7 +170,7 @@ public class StoreService { * @param newName 新文件名 */ public void rename(int uid, String path, String oldName, String newName) throws HasResultException { - if ( !(DiskConfig.getPathHandler() instanceof RawPathHandler)){ + if ( uid != 0 && DiskConfig.STORE_TYPE == StoreType.UNIQUE){ return; } String base = DiskConfig.getRawFileStoreRootPath(uid); -- Gitee