Merge remote-tracking branch 'origin/main'
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -12,7 +12,7 @@
|
||||
<module>yudao-gateway</module>
|
||||
<module>yudao-framework</module>
|
||||
<!-- Server 主项目 -->
|
||||
<module>yudao-server</module>
|
||||
<!-- <module>yudao-server</module>-->
|
||||
<!-- 各种 module 拓展 -->
|
||||
<module>yudao-module-system</module>
|
||||
<module>yudao-module-infra</module>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM openjdk:17-jre-slim
|
||||
FROM 172.16.46.66:10043/base-service/eclipse-temurin:21-jre
|
||||
|
||||
# 设置应用目录
|
||||
WORKDIR /app
|
||||
|
||||
@@ -7,8 +7,8 @@ spring:
|
||||
username: # Nacos 账号
|
||||
password: # Nacos 密码
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: ${namespace.name} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
config: # 【注册中心】配置项
|
||||
namespace: ${namespace.name} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
@@ -170,9 +170,9 @@ public class FileController {
|
||||
@Operation(summary = "校验验证码")
|
||||
public CommonResult<String> verifyCode(@Valid @RequestParam Long fileId, @RequestParam String code) throws Exception {
|
||||
Long userId = getLoginUserId();
|
||||
byte[] content = fileService.verifyCodeAndGetFile(fileId, userId, code);
|
||||
if(content == null || content.length == 0){
|
||||
return CommonResult.customize(null, HttpStatus.INTERNAL_SERVER_ERROR.value(), "验证码校验失败");
|
||||
boolean flag = fileService.verifyCode(fileId, userId, code);
|
||||
if(!flag){
|
||||
return CommonResult.customize(null, HttpStatus.INTERNAL_SERVER_ERROR.value(), "验证码错误");
|
||||
}
|
||||
return CommonResult.customize(null, HttpStatus.OK.value(), "验证码校验通过");
|
||||
}
|
||||
|
||||
@@ -102,4 +102,5 @@ public interface FileService {
|
||||
*/
|
||||
FileDO getActiveFileById(Long fileId);
|
||||
|
||||
boolean verifyCode(Long fileId, Long userId, String code) throws Exception;
|
||||
}
|
||||
|
||||
@@ -289,5 +289,15 @@ public class FileServiceImpl implements FileService {
|
||||
// 由于 FileDO 没有状态字段,直接查主键即为生效中的文件
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller extends Abstra
|
||||
|
||||
#if($isFileUpload && $isFileUpload == true)
|
||||
static {
|
||||
FileUploadController annotation = DemoContractController.class.getAnnotation(FileUploadController.class);
|
||||
FileUploadController annotation = ${sceneEnum.prefixClass}${table.className}Controller.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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 lombok.Data;
|
||||
|
||||
@@ -9,11 +8,29 @@ import lombok.Data;
|
||||
*/
|
||||
@Schema(description = "对外接口账号创建请求 VO")
|
||||
@Data
|
||||
public class UserCreateRequestVO extends AdminUserDO {
|
||||
public class UserCreateRequestVO {
|
||||
@Schema(description = "用户名", required = true)
|
||||
private String bimRemoteUser;
|
||||
@Schema(description = "密码", required = true)
|
||||
private String bimRemotePwd;
|
||||
@Schema(description = "请求ID", required = true)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package cn.iocoder.yudao.module.system.service.sync;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
|
||||
@@ -20,6 +21,7 @@ import java.beans.PropertyDescriptor;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
|
||||
@Service
|
||||
public class UserSyncServiceImpl implements UserSyncService {
|
||||
@@ -39,6 +41,11 @@ public class UserSyncServiceImpl implements UserSyncService {
|
||||
if (requestVO.getSex() != null) {
|
||||
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);
|
||||
UserCreateResponseVO resp = new UserCreateResponseVO();
|
||||
resp.setUid(String.valueOf(userId));
|
||||
|
||||
Reference in New Issue
Block a user