var getvideosbatchpush = function(para){ return new Promise(function(resolve, reject){ $.ajax({ url: "/v1/pingan/videos-batch-push", type: "GET", // dataType: 'jsonp', contentType: "application/json", data: para || {}, success: function(resp, status, xhr){ if(resp.status == "OK"){ resolve(resp); }else{ reject(resp); } }, error: function(xhr, errorType, error){ Notify.fail("網絡開小差了,請稍後再試"); } }); }); }; var deletevideosbatchpush = function(para){ return new Promise(function(resolve, reject){ $.ajax({ url: "/v1/pingan/videos-batch-push/" + para.id, type: "DELETE", // dataType: 'jsonp', contentType: "application/json", data: JSON.stringify(para || {}), success: function(resp, status, xhr){ if(resp.status == "OK"){ resolve(resp); }else{ reject(resp); } }, error: function(xhr, errorType, error){ Notify.fail("網絡開小差了,請稍後再試"); }, }); }); }; var savevideosbatchpush = function(para){ return new Promise(function(resolve, reject){ $.ajax({ url: "/v1/pingan/videos-batch-push", type: "POST", // dataType: "jsonp", contentType: "application/json", data: JSON.stringify(para || {}), success: function(resp, status, xhr){ if(resp.status == "OK"){ resolve(resp); } else{ reject(resp); } }, error: function(xhr, errorType, error){ Notify.fail("網絡開小差了,請稍後再試"); }, }); }); }; var putvideosbatchpush = function(para){ return new Promise(function(resolve, reject){ var id = para.id; var url = "/v1/pingan/videos-batch-push/" + id; $.ajax({ url: url, type: "PUT", // dataType: 'jsonp', contentType: "application/json", data: JSON.stringify(para || {}), success: function(resp, status, xhr){ if(resp.status == "OK"){ resolve(resp); } else{ reject(resp); } }, error: function(xhr, errorType, error){ Notify.fail("網絡開小差了,請稍後再試"); } }); }); };