新增备案信息,禁止上传类型,删除支持密码功能

新增备案信息,禁止上传类型,删除支持密码功能

Signed-off-by: 高雄 <admin@cxcp.com>
This commit is contained in:
高雄 2023-04-10 09:34:37 +00:00 committed by Gitee
parent 75a46a14a8
commit c7367dfcec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 17 additions and 0 deletions

View File

@ -1,7 +1,9 @@
package cn.keking.utils;
import cn.keking.config.ConfigConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.util.HtmlUtils;
@ -174,4 +176,19 @@ public class KkFileUtils {
return true;
}
/**
* 判断文件是否允许上传
*
* @param file 文件扩展名
* @return 是否允许上传
*/
public static boolean isAllowedUpload(String file) {
String fileType = suffixFromFileName(file);
for (String type : ConfigConstants.getprohibit()) {
if (type.equals(fileType))
return false;
}
return !ObjectUtils.isEmpty(fileType);
}
}