Commit 7351f520 authored by wujiang's avatar wujiang

提交代码

parent d959721f
...@@ -228,7 +228,7 @@ public class UnitInfoController extends BaseController { ...@@ -228,7 +228,7 @@ public class UnitInfoController extends BaseController {
throw new BadRequest("只支持jpg,jpeg,png图片类型上传"); throw new BadRequest("只支持jpg,jpeg,png图片类型上传");
} }
//判断文件后缀 //判断文件后缀
String filename = file.getName(); String filename = file.getOriginalFilename();
String extension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(); String extension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
if(!ALLOWED_TYPES.contains(extension)) if(!ALLOWED_TYPES.contains(extension))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment