添加 webp 格式
This commit is contained in:
@@ -64,13 +64,8 @@ public class ServletUtils {
|
||||
* </listener-class></listener>
|
||||
*/
|
||||
public static HttpServletRequest getRequest(){
|
||||
HttpServletRequest request = null;
|
||||
try{
|
||||
request = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||
if (request == null){
|
||||
return null;
|
||||
}
|
||||
return request;
|
||||
return ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||
}catch(Exception e){
|
||||
return null;
|
||||
}
|
||||
@@ -83,16 +78,11 @@ public class ServletUtils {
|
||||
* <filter-name>requestContextFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping>
|
||||
*/
|
||||
public static HttpServletResponse getResponse(){
|
||||
HttpServletResponse response = null;
|
||||
try{
|
||||
response = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getResponse();
|
||||
if (response == null){
|
||||
return null;
|
||||
}
|
||||
return ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getResponse();
|
||||
}catch(Exception e){
|
||||
return null;
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,9 +112,8 @@ public class ServletUtils {
|
||||
public static boolean isStaticFile(String uri){
|
||||
if (STATIC_FILE == null){
|
||||
try {
|
||||
throw new Exception("检测到“application.yml”中没有配置“web.staticFile”属性。"
|
||||
+ "配置示例:\n#静态文件后缀\nweb.staticFile=.css,.js,.png,.jpg,.gif,"
|
||||
+ ".jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk");
|
||||
throw new Exception("检测到“application.yml”中没有配置“web.staticFile”属性。配置示例:\n#静态文件后缀\nweb.staticFile=" +
|
||||
".css,.js,.map,.png,.jpg,.gif,.jpeg,.webp,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ web:
|
||||
excludePathPatterns: ~
|
||||
|
||||
# 静态文件后缀,过滤静态文件,以提高访问性能。
|
||||
staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.webp,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
|
||||
# 静态资源缓存周期 Cache-Control,单位秒,1年
|
||||
staticCachePeriod: 31536000
|
||||
@@ -722,7 +722,7 @@ file:
|
||||
maxFileSize: '500*1024*1024'
|
||||
|
||||
# 设置允许上传的文件后缀(全局设置)
|
||||
imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||
imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,webp,
|
||||
mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ $(function() {
|
||||
fileNameInputId: '${p.fileNameInputId}',
|
||||
uploadType: '${p.uploadType}',
|
||||
maxFileSize: "#{isNotBlank(p.maxFileSize)?p.maxFileSize:@Global.getConfig('file.maxFileSize', '500*1024*1024')}",
|
||||
imageAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.imageAllowSuffixes", ".gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,")}',
|
||||
imageAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.imageAllowSuffixes", ".gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,webp,")}',
|
||||
mediaAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.mediaAllowSuffixes", ".flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,")}',
|
||||
fileAllowSuffixes: '${isNotBlank(p.allowSuffixes)?p.allowSuffixes:@Global.getConfig("file.fileAllowSuffixes", ".doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,")}',
|
||||
chunked: "#{__info_type=='0'?false:@Global.getConfig('file.chunked', 'true')}",
|
||||
|
||||
@@ -801,7 +801,7 @@ web:
|
||||
excludePathPatterns: ~
|
||||
|
||||
# # 静态文件后缀,过滤静态文件,以提高访问性能。
|
||||
# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.webp,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
#
|
||||
# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
||||
# staticFileExcludeUri: /druid/
|
||||
@@ -860,7 +860,7 @@ file:
|
||||
# maxFileSize: '500*1024*1024'
|
||||
#
|
||||
# # 设置允许上传的文件后缀(全局设置)
|
||||
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,webp,
|
||||
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
#
|
||||
|
||||
@@ -801,7 +801,7 @@ web:
|
||||
excludePathPatterns: ~
|
||||
|
||||
# # 静态文件后缀,过滤静态文件,以提高访问性能。
|
||||
# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.webp,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
#
|
||||
# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
||||
# staticFileExcludeUri: /druid/
|
||||
@@ -860,7 +860,7 @@ file:
|
||||
# maxFileSize: '500*1024*1024'
|
||||
#
|
||||
# # 设置允许上传的文件后缀(全局设置)
|
||||
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,webp,
|
||||
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user