| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- var AttachmentService = {};
- /**
- * 获取文件属性
- */
- AttachmentService.getFileProperties = function (data) {
- return new Promise(function(resolve, reject) {
- $.ajax({
- url: Common.getApi(
- "/api/attachmentPanelResource/getFileProperties"
- ),
- type: "get",
- dataType: "json",
- data: data,
- beforeSend: function (request) {
- addTokenToRequest(request);
- },
- success: function (data) {
- resolve(data);
- }
- });
- });
- },
- /**
- * 下载附件
- */
- AttachmentService.downloadAttachment = function (data) {
- return new Promise(function(resolve, reject) {
- $.ajax({
- url: Common.getApi("/api/file/attachmentDownloadPath"),
- type: "get",
- data: data,
- beforeSend: function (request) {
- addTokenToRequest(request);
- },
- success: function (data) {
- resolve(data);
- }
- });
- });
- },
- /**
- * 删除附件
- */
- AttachmentService.deleteAttachment = function (data) {
- return new Promise(function(resolve, reject) {
- $.ajax({
- url: Common.getApi(
- "/api/attachmentPanelResource/deleteAttachment"
- ),
- type: "get",
- data: data,
- beforeSend: function (request) {
- addTokenToRequest(request);
- },
- success: function (data) {
- resolve(data);
- }
- });
- });
- }
|