|
|
@@ -964,7 +964,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
public Boolean uploadImage(Long userId, MultipartFile file) throws IOException {
|
|
|
BaseStudentUser studentUser = studentbaseManagerBaseStudentUserMapper.selectById(userId);
|
|
|
String[] imgSuffix = new String[]{"png", "jpg", "jpeg"};
|
|
|
- String suffix = StringUtils.substringAfterLast(file.getName(), StringPool.DOT);
|
|
|
+ String suffix = StringUtils.substringAfterLast(file.getOriginalFilename(), StringPool.DOT);
|
|
|
if (!Arrays.asList(imgSuffix).contains(suffix)) {
|
|
|
throw new MyException("图片格式不正确!");
|
|
|
}
|