Merge remote-tracking branch 'origin/main'

This commit is contained in:
qianshijiang
2025-09-12 14:46:49 +08:00
9 changed files with 46 additions and 11 deletions

View File

@@ -12,7 +12,7 @@
<module>yudao-gateway</module> <module>yudao-gateway</module>
<module>yudao-framework</module> <module>yudao-framework</module>
<!-- Server 主项目 --> <!-- Server 主项目 -->
<module>yudao-server</module> <!-- <module>yudao-server</module>-->
<!-- 各种 module 拓展 --> <!-- 各种 module 拓展 -->
<module>yudao-module-system</module> <module>yudao-module-system</module>
<module>yudao-module-infra</module> <module>yudao-module-infra</module>

View File

@@ -1,4 +1,4 @@
FROM openjdk:17-jre-slim FROM 172.16.46.66:10043/base-service/eclipse-temurin:21-jre
# 设置应用目录 # 设置应用目录
WORKDIR /app WORKDIR /app

View File

@@ -7,8 +7,8 @@ spring:
username: # Nacos 账号 username: # Nacos 账号
password: # Nacos 密码 password: # Nacos 密码
discovery: # 【配置中心】配置项 discovery: # 【配置中心】配置项
namespace: ${namespace.name} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换 namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
config: # 【注册中心】配置项 config: # 【注册中心】配置项
namespace: ${namespace.name} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换 namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP

View File

@@ -170,9 +170,9 @@ public class FileController {
@Operation(summary = "校验验证码") @Operation(summary = "校验验证码")
public CommonResult<String> verifyCode(@Valid @RequestParam Long fileId, @RequestParam String code) throws Exception { public CommonResult<String> verifyCode(@Valid @RequestParam Long fileId, @RequestParam String code) throws Exception {
Long userId = getLoginUserId(); Long userId = getLoginUserId();
byte[] content = fileService.verifyCodeAndGetFile(fileId, userId, code); boolean flag = fileService.verifyCode(fileId, userId, code);
if(content == null || content.length == 0){ if(!flag){
return CommonResult.customize(null, HttpStatus.INTERNAL_SERVER_ERROR.value(), "验证码校验失败"); return CommonResult.customize(null, HttpStatus.INTERNAL_SERVER_ERROR.value(), "验证码错误");
} }
return CommonResult.customize(null, HttpStatus.OK.value(), "验证码校验通过"); return CommonResult.customize(null, HttpStatus.OK.value(), "验证码校验通过");
} }

View File

@@ -102,4 +102,5 @@ public interface FileService {
*/ */
FileDO getActiveFileById(Long fileId); FileDO getActiveFileById(Long fileId);
boolean verifyCode(Long fileId, Long userId, String code) throws Exception;
} }

View File

@@ -289,5 +289,15 @@ public class FileServiceImpl implements FileService {
// 由于 FileDO 没有状态字段,直接查主键即为生效中的文件 // 由于 FileDO 没有状态字段,直接查主键即为生效中的文件
return fileMapper.selectById(fileId); return fileMapper.selectById(fileId);
} }
@Override
public boolean verifyCode(Long fileId, Long userId, String code) {
// 开发模式下,验证码直接获取配置进行比对
if (StringUtils.isNotEmpty(fixedVerifyCode)) {
return fixedVerifyCode.equals(code);
} else {
String codeKey = String.format(RedisKeyConstants.FILE_VERIFICATION_CODE, userId, fileId);
return VerificationCodeUtil.verifyCode(codeKey, code, stringRedisTemplate);
}
}
} }

View File

@@ -65,7 +65,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller extends Abstra
#if($isFileUpload && $isFileUpload == true) #if($isFileUpload && $isFileUpload == true)
static { static {
FileUploadController annotation = DemoContractController.class.getAnnotation(FileUploadController.class); FileUploadController annotation = ${sceneEnum.prefixClass}${table.className}Controller.class.getAnnotation(FileUploadController.class);
if (annotation != null) { if (annotation != null) {
setFileUploadInfo(annotation); setFileUploadInfo(annotation);
} }

View File

@@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.system.controller.admin.sync.vo.user; package cn.iocoder.yudao.module.system.controller.admin.sync.vo.user;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -9,11 +8,29 @@ import lombok.Data;
*/ */
@Schema(description = "对外接口账号创建请求 VO") @Schema(description = "对外接口账号创建请求 VO")
@Data @Data
public class UserCreateRequestVO extends AdminUserDO { public class UserCreateRequestVO {
@Schema(description = "用户名", required = true) @Schema(description = "用户名", required = true)
private String bimRemoteUser; private String bimRemoteUser;
@Schema(description = "密码", required = true) @Schema(description = "密码", required = true)
private String bimRemotePwd; private String bimRemotePwd;
@Schema(description = "请求ID", required = true) @Schema(description = "请求ID", required = true)
private String bimRequestId; private String bimRequestId;
@Schema(description = "用户归属部门(多个为逗号分割)", required = true)
private String deptIds;
@Schema(description = "用户名")
private String username;
@Schema(description = "密码")
private String password;
@Schema(description = "昵称")
private String nickname;
@Schema(description = "注释")
private String remark;
@Schema(description = "邮箱")
private String email;
@Schema(description = "电话")
private String mobile;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "状态")
private Integer status;
} }

View File

@@ -1,8 +1,9 @@
package cn.iocoder.yudao.module.system.service.sync; package cn.iocoder.yudao.module.system.service.sync;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.user.*; import cn.iocoder.yudao.module.system.controller.admin.sync.vo.user.*;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
@@ -20,6 +21,7 @@ import java.beans.PropertyDescriptor;
import java.util.*; import java.util.*;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
@Service @Service
public class UserSyncServiceImpl implements UserSyncService { public class UserSyncServiceImpl implements UserSyncService {
@@ -39,6 +41,11 @@ public class UserSyncServiceImpl implements UserSyncService {
if (requestVO.getSex() != null) { if (requestVO.getSex() != null) {
saveReqVO.setSex(SyncVerifyUtil.convertExternalToInternal(requestVO.getSex())); saveReqVO.setSex(SyncVerifyUtil.convertExternalToInternal(requestVO.getSex()));
} }
LoginUser loginUser = getLoginUser();
Long tenantId = Optional.ofNullable(loginUser).orElse(new LoginUser()).getTenantId();
TenantContextHolder.setTenantId(tenantId);
// 中铝 e 办不会设置密码,设置默认密码
saveReqVO.setPassword("ZLEB");
Long userId = adminUserService.createUser(saveReqVO); Long userId = adminUserService.createUser(saveReqVO);
UserCreateResponseVO resp = new UserCreateResponseVO(); UserCreateResponseVO resp = new UserCreateResponseVO();
resp.setUid(String.valueOf(userId)); resp.setUid(String.valueOf(userId));