From efe51c2947c76ee863593c2ecfe3a2e65b3e742f Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期二, 24 十月 2023 09:11:02 +0800
Subject: [PATCH] 企业端
---
server/company/src/main/java/com/doumee/api/common/PublicController.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/server/company/src/main/java/com/doumee/api/common/PublicController.java b/server/company/src/main/java/com/doumee/api/common/PublicController.java
index ab7e6b6..10c9278 100644
--- a/server/company/src/main/java/com/doumee/api/common/PublicController.java
+++ b/server/company/src/main/java/com/doumee/api/common/PublicController.java
@@ -76,9 +76,10 @@
MultipartFile file = multipartRequest.getFile(fileNames.next());
String fileName = file.getOriginalFilename();
String suffix = fileName.substring(fileName.lastIndexOf("."));
- if ( !StringUtils.equalsIgnoreCase(suffix, ".jpg") || !StringUtils.equalsIgnoreCase(suffix, ".png")) {
+ if ( !StringUtils.equalsIgnoreCase(suffix, ".jpg") && !StringUtils.equalsIgnoreCase(suffix, ".png")) {
context.put("code", 0);
context.put("message", "瀵逛笉璧凤紝鏂囦欢鏍煎紡涓婁紶鏈夎锛�");
+ return;
}
}
upload(multipartRequest, response, folder + "/",
@@ -125,7 +126,7 @@
}
String nowDate = DateUtil.getNowShortDate();// 褰撳墠鏃堕棿锛堝勾鏈堟棩锛�
String fileName = UUID.randomUUID().toString() + nfix;
- String tempFileName = nowDate + "/" + fileName;
+ String tempFileName = nowDate + "/" + fileName;
String key = folder + tempFileName;// 鏂囦欢鍚�
ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key);
if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) {
--
Gitblit v1.9.3