调整文件上传处理类
This commit is contained in:
parent
1c36932597
commit
5852034f7e
@ -9,6 +9,7 @@ import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
@ -27,6 +28,11 @@ import java.util.List;
|
||||
@Configuration
|
||||
public class BeanConfig {
|
||||
|
||||
@Bean(name = "multipartResolver")
|
||||
public CommonsMultipartResolver getCommonsMultipartResolver() {
|
||||
return new CommonsMultipartResolver();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HttpMessageConverter configureMessageConverters() {
|
||||
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
||||
|
@ -495,7 +495,8 @@ public class FileServiceImpl extends DefaultBaseService implements IFileService
|
||||
try {
|
||||
multimediaInfo = encoder.getInfo(source);
|
||||
} catch (EncoderException e) {
|
||||
throw new SystemException("文件解析错误");
|
||||
e.printStackTrace();
|
||||
throw new SystemException("文件解析错误", e);
|
||||
}
|
||||
long fileDuration = multimediaInfo.getDuration() / 1000;
|
||||
if (fileDuration > maxDuration) {
|
||||
|
Loading…
Reference in New Issue
Block a user