优化暂未配置存储提供商提示

pull/65/head
awenes 2023-10-06 20:00:21 +08:00
parent cb0104eb22
commit e229b1a723
3 changed files with 8 additions and 7 deletions

View File

@ -39,11 +39,11 @@ public class NoneStorage extends AbstractStorage {
@Override
public String upload(@NotNull String fileName,
InputStream inputStream) throws StorageProviderException {
throw new StorageProviderException("暂未配置存储提供商,请联系管理员");
throw new StorageProviderException("暂未配置存储提供商");
}
@Override
public String download(String path) throws StorageProviderException {
throw new StorageProviderException("暂未配置存储提供商,请联系管理员");
throw new StorageProviderException("暂未配置存储提供商");
}
}

View File

@ -40,19 +40,19 @@ import jakarta.validation.constraints.NotNull;
public class ChangePasswordRequest implements Serializable {
@Serial
private static final long serialVersionUID = 5681761697876754485L;
private static final long serialVersionUID = 5681761697876754485L;
/**
*
*/
@NotEmpty(message = "新密码不能为空")
@Parameter(description = "新密码")
private String newPassword;
private String newPassword;
/**
*
*/
@NotEmpty(message = "旧密码不能为空")
@Parameter(description = "旧密码")
private String oldPassword;
private String oldPassword;
}

View File

@ -98,8 +98,9 @@ public class UserProfileServiceImpl implements UserProfileService {
//获取用户
AdministratorEntity administrator = getCurrentUser();
//校验旧密码
if (!passwordEncoder.matches(param.getOldPassword(),administrator.getPassword())){
logger.error("用户ID: [{}] 用户名: [{}] 修改密码失败,原密码错误",administrator.getId(),administrator.getUsername());
if (!passwordEncoder.matches(param.getOldPassword(), administrator.getPassword())) {
logger.error("用户ID: [{}] 用户名: [{}] 修改密码失败,原密码错误", administrator.getId(),
administrator.getUsername());
throw new PasswordValidatedFailException("旧密码错误");
}
//修改密码