+
@@ -126,35 +125,12 @@
minView: "month",
autoclose: true
});
- //文件上传
- $('#fileUrlId').on('change.bs.fileinput ', function (e) {
- // 处理自己的业务
- var file = e.target.files[0];
- var data = new FormData();
- data.append("file", file);
- $.ajax({
- type: "POST",
- url: ctx + "common/upload",
- data: data,
- cache: false,
- contentType: false,
- processData: false,
- dataType: 'json',
- success: function(result) {
- if (result.code == web_status.SUCCESS) {
- $("#fileUrl").val(result.url);
- $("#fileName").val(result.originalFilename);
- } else {
- $("#fileUrl").val("");
- $("#fileName").val("");
- }
- },
- error: function(error) {
- $.modal.alertWarning("文件上传失败。");
- }
- });
- });
+ function downloadFile(){
+ var fileUrl = $("#fileUrl").val();
+ window.location.href = ctx + "common/download/resource?resource=" + encodeURI(fileUrl) ;
+ }
+