⬆️ 因旧版本 Spring 的安全问题, 升级 Spring 为 2.5.4 版本, 兼容新版本

This commit is contained in:
赵俊
2021-09-19 09:53:19 +08:00
parent 7da1b454dc
commit d22e2e872a
6 changed files with 9 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package im.zhaojun.zfile;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
/**
@@ -10,6 +11,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
*/
@EnableAsync
@SpringBootApplication
@EnableJpaRepositories("im.zhaojun.zfile.repository")
@EnableAspectJAutoProxy(exposeProxy = true)
public class ZfileApplication {

View File

@@ -11,7 +11,7 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* @author zhaojun
@@ -31,7 +31,7 @@ public class OneDriveConfig {
ClientHttpRequestInterceptor interceptor = (httpRequest, bytes, clientHttpRequestExecution) -> {
HttpHeaders headers = httpRequest.getHeaders();
Integer driveId = Integer.valueOf(((LinkedList)headers.get("driveId")).get(0).toString());
Integer driveId = Integer.valueOf(((List)headers.get("driveId")).get(0).toString());
StorageConfig accessTokenConfig =
storageConfigService.findByDriveIdAndKey(driveId, StorageConfigConstant.ACCESS_TOKEN_KEY);

View File

@@ -2,6 +2,7 @@ package im.zhaojun.zfile.model.entity;
import im.zhaojun.zfile.model.enums.StorageTypeEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -15,6 +16,7 @@ import javax.persistence.Lob;
*/
@Entity(name = "STORAGE_CONFIG")
@Data
@NoArgsConstructor
public class StorageConfig {
@Id

View File

@@ -67,7 +67,7 @@ public class DriveConfigService {
* @return 驱动器列表
*/
public List<DriveConfig> list() {
Sort sort = new Sort(Sort.Direction.ASC,"orderNum");
Sort sort = Sort.by(Sort.Direction.ASC,"orderNum");
return driverConfigRepository.findAll(sort);
}
@@ -81,7 +81,7 @@ public class DriveConfigService {
DriveConfig driveConfig = new DriveConfig();
driveConfig.setEnable(true);
Example<DriveConfig> example = Example.of(driveConfig);
Sort sort = new Sort(Sort.Direction.ASC,"orderNum");
Sort sort = Sort.by(Sort.Direction.ASC,"orderNum");
return driverConfigRepository.findAll(example, sort);
}