🐛 修复多文件上传失败的问题,以及图片选择框翻页之后无法选择的问题

pull/69/head
ruibaby 2018-12-14 23:58:26 +08:00
parent 496f0852f0
commit 006ab2f949
9 changed files with 23 additions and 34 deletions

View File

@ -21,7 +21,7 @@ import javax.annotation.PostConstruct;
*/
@Slf4j
@Configuration
public class FreeMarkerConfig {
public class FreeMarkerAutoConfiguration {
@Autowired
private freemarker.template.Configuration configuration;

View File

@ -30,7 +30,7 @@ import java.util.Locale;
@EnableWebMvc
@ComponentScan(basePackages = "cc.ryanc.halo.web.controller")
@PropertySource(value = "classpath:application.yaml", ignoreResourceNotFound = true, encoding = "UTF-8")
public class MvcConfig implements WebMvcConfigurer {
public class WebMvcAutoConfiguration implements WebMvcConfigurer {
@Autowired
private LoginInterceptor loginInterceptor;

View File

@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
*/
@Component
public class SpringUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext;
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -65,12 +65,9 @@
maxFileCount: 100,
enctype : 'multipart/form-data',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data.success=="1"){
$("#uploadForm").hide(400);
halo.showMsgAndReload(data.message,'success',1000);
}
}).on("filebatchuploadcomplete",function (event, files, extra) {
$("#uploadForm").hide(400);
halo.showMsgAndReload('上传成功!','success',1000);
});
}
$(document).ready(function () {

View File

@ -87,12 +87,9 @@
maxFileCount: 10,
enctype : 'multipart/form-data',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data.success=="1"){
$("#uploadForm").hide(400);
halo.showMsgAndReload(data.message,'success',1000);
}
}).on("filebatchuploadcomplete",function (event, files, extra) {
$("#uploadForm").hide(400);
halo.showMsgAndReload('上传成功!','success',1000);
});
$(document).ready(function(){
var clipboard = new Clipboard('.thumbnail');

View File

@ -36,16 +36,16 @@
<@spring.message code='admin.pageinfo.text.no' />${attachments.number+1}/${attachments.totalPages}<@spring.message code='admin.pageinfo.text.page' />
</div>
<div class="btn-group pull-right btn-group-sm" role="group">
<a class="btn btn-default <#if !attachments.hasPrevious()>disabled</#if>" href="/admin/attachments/select" >
<a class="btn btn-default <#if !attachments.hasPrevious()>disabled</#if>" href="/admin/attachments/select?id=${id}" >
<@spring.message code='admin.pageinfo.btn.first' />
</a>
<a class="btn btn-default <#if !attachments.hasPrevious()>disabled</#if>" href="/admin/attachments/select?page=${attachments.number-1}" >
<a class="btn btn-default <#if !attachments.hasPrevious()>disabled</#if>" href="/admin/attachments/select?page=${attachments.number-1}&id=${id}" >
<@spring.message code='admin.pageinfo.btn.pre' />
</a>
<a class="btn btn-default <#if !attachments.hasNext()>disabled</#if>" href="/admin/attachments/select?page=${attachments.number+1}">
<a class="btn btn-default <#if !attachments.hasNext()>disabled</#if>" href="/admin/attachments/select?page=${attachments.number+1}&id=${id}">
<@spring.message code='admin.pageinfo.btn.next' />
</a>
<a class="btn btn-default <#if !attachments.hasNext()>disabled</#if>" href="/admin/attachments/select?page=${attachments.totalPages-1}">
<a class="btn btn-default <#if !attachments.hasNext()>disabled</#if>" href="/admin/attachments/select?page=${attachments.totalPages-1}&id=${id}">
<@spring.message code='admin.pageinfo.btn.last' />
</a>
</div>
@ -86,12 +86,9 @@
maxFileCount: 10,
enctype : 'multipart/form-data',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data.success=="1"){
$("#uploadForm").hide(400);
halo.showMsgAndReload(data.message,'success',1000);
}
}).on("filebatchuploadcomplete",function (event, files, extra) {
$("#uploadForm").hide(400);
halo.showMsgAndReload('上传成功!','success',1000);
});
function doTransport(url) {
parent.$('#${id}').val(url);

View File

@ -103,12 +103,9 @@
maxFileCount: 100,
enctype : 'multipart/form-data',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data.success=="1"){
$("#uploadForm").hide(400);
halo.showMsgAndParentRedirect(data.message,'success',1000,"/admin/attachments");
}
}).on("filebatchuploadcomplete",function (event, files, extra) {
$("#uploadForm").hide(400);
halo.showMsgAndReload('上传成功!','success',1000);
});
}