Commit 61e3e41f by WeiCong

调整上传文件类型逻辑

parent 04dccee6
......@@ -40,7 +40,7 @@ public class FileTypeInterceptor extends HandlerInterceptorAdapter {
MultipartFile multipartFile = multipartRequest.getFile(formKey);
String filename = multipartFile.getOriginalFilename();
//判断是否为限制文件类型
if (!checkFile(filename)) {
if (checkLimitFile(filename)) {
//限制文件类型,请求转发到原始请求页面,并携带错误提示信息
flag = false;
response.setContentType("application/json; charset=utf-8");
......@@ -59,7 +59,7 @@ public class FileTypeInterceptor extends HandlerInterceptorAdapter {
/**
* 判断是否为允许的上传文件类型,true表示允许
*/
private boolean checkFile(String fileName) {
private boolean checkLimitFile(String fileName) {
//设置允许上传文件类型
// String suffixList = "jpg,gif,png,ico,bmp,jpeg";
String suffixList = type_list;
......
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