From 5248d75a6ed9bdd58ab3f6c82a82cc67a6a72001 Mon Sep 17 00:00:00 2001 From: Odboy Date: Tue, 30 Dec 2025 21:18:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(upload):=20=E4=BF=AE=E5=A4=8D=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复了在MAC系统下上传路径中用户名前缺少斜杠的问题 - 确保上传路径格式的一致性 --- .../server/core/KitFileLocalUploadHelper.java | 2 +- .../openapi/SystemCaptchaOpenController.java | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 cutejava/cutejava-module-system/src/main/java/cn/odboy/system/openapi/SystemCaptchaOpenController.java diff --git a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/server/core/KitFileLocalUploadHelper.java b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/server/core/KitFileLocalUploadHelper.java index 720ffa44..d9b20580 100644 --- a/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/server/core/KitFileLocalUploadHelper.java +++ b/cutejava/cutejava-framework/src/main/java/cn/odboy/framework/server/core/KitFileLocalUploadHelper.java @@ -53,7 +53,7 @@ public class KitFileLocalUploadHelper { if (StrUtil.isBlank(currentUserName)) { return PATH_MAC.replace("${appName}", appName).replace("${username}", ""); } - return PATH_MAC.replace("${appName}", appName).replace("${username}", currentUserName); + return PATH_MAC.replace("${appName}", appName).replace("${username}", "/" + currentUserName); } return PATH_LINUX.replace("${appName}", appName); } diff --git a/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/openapi/SystemCaptchaOpenController.java b/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/openapi/SystemCaptchaOpenController.java new file mode 100644 index 00000000..16493fdb --- /dev/null +++ b/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/openapi/SystemCaptchaOpenController.java @@ -0,0 +1,42 @@ +/* + * Copyright 2021-2025 Odboy + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.odboy.system.openapi; + +import cn.odboy.annotation.AnonymousPostMapping; +import cn.odboy.system.service.SystemAuthService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/auth") +@Api(tags = "系统:验证码管理") +public class SystemCaptchaOpenController { + + @Autowired + private SystemAuthService systemAuthService; + + @ApiOperation("获取验证码") + @AnonymousPostMapping(value = "/captcha/getImage") + public ResponseEntity> getCode() { + Map imgResult = systemAuthService.getCaptchaInfo(); + return ResponseEntity.ok(imgResult); + } +}