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); + } +}