Comparing version 1.0.1 to 1.0.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FHUpload=e():t.FHUpload=e()}(self,(()=>{return t={394:function(t,e,r){var n;function o(){"use strict";o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c=(j="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",a=j.asyncIterator||"@@asyncIterator",u=j.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(e,r,n,o){var c,a,u,s;return r=r&&r.prototype instanceof m?r:m,r=Object.create(r.prototype),o=new k(o||[]),i(r,"_invoke",{value:(c=e,a=n,u=o,s=h,function(e,r){if(s===d)throw Error("Generator is already running");if(s===v){if("throw"===e)throw r;return{value:t,done:!0}}for(u.method=e,u.arg=r;;){var n=u.delegate;if(n&&(n=function e(r,n){var o=n.method,i=r.iterator[o];return i===t?(n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g):"throw"===(o=p(i,r.iterator,n.arg)).type?(n.method="throw",n.arg=o.arg,n.delegate=null,g):(i=o.arg)?i.done?(n[r.resultName]=i.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,u),n)){if(n===g)continue;return n}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(s===h)throw s=v,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(s=d,"normal"===(n=p(c,a,u)).type){if(s=u.done?v:y,n.arg===g)continue;return{value:n.arg,done:u.done}}"throw"===n.type&&(s=v,u.method="throw",u.arg=n.arg)}})}),r}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",y="suspendedYield",d="executing",v="completed",g={};function m(){}function w(){}function b(){}var j,x,E=(l(j={},c,(function(){return this})),(x=(x=Object.getPrototypeOf)&&x(x(_([]))))&&x!==r&&n.call(x,c)&&(j=x),b.prototype=m.prototype=Object.create(j));function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){var r;i(this,"_invoke",{value:function(o,i){function c(){return new e((function(r,c){!function r(o,i,c,a){var u;if("throw"!==(o=p(t[o],t,i)).type)return(i=(u=o.arg).value)&&"object"==s(i)&&n.call(i,"__await")?e.resolve(i.__await).then((function(t){r("next",t,c,a)}),(function(t){r("throw",t,c,a)})):e.resolve(i).then((function(t){u.value=t,c(u)}),(function(t){return r("throw",t,c,a)}));a(o.arg)}(o,i,r,c)}))}return r=r?r.then(c,c):c()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var r,o=e[c];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(o=function o(){for(;++r<e.length;)if(n.call(e,r))return o.value=e[r],o.done=!1,o;return o.value=t,o.done=!0,o}).next=o}throw new TypeError(s(e)+" is not iterable")}return i(E,"constructor",{value:w.prototype=b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},O(S.prototype),l(S.prototype,a,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var c=new S(f(t,r,n,o),i);return e.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},O(E),l(E,u,"Generator"),l(E,c,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},e.values=_,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;0<=i;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var u=n.call(c,"catchLoc"),s=n.call(c,"finallyLoc");if(u&&s){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(u){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}var c=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,P(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var c=t.apply(e,r);function a(t){i(c,n,o,a,u,"next",t)}function u(t){i(c,n,o,a,u,"throw",t)}a(void 0)}))}}function a(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)),n}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){var n,o;n=t,o=r[e],(e=function(t){return t=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return String(t);if("object"!=s(r=r.call(t,"string")))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"==s(t)?t:t+""}(e))in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n=function(){function t(t,r){return e.apply(this,arguments)}function e(){return(e=c(o().mark((function t(e,r){var n,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=e.raw||e,t.prev=1,n="",t.next=5,lrz(e,{quality:r});case 5:return i=t.sent,n=new File([i.file],e.name,{type:"image/jpeg",lastModified:Date.now()}),t.abrupt("return",n);case 10:return t.prev=10,t.t0=t.catch(1),t.abrupt("return","");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})))).apply(this,arguments)}function r(){return(r=c(o().mark((function e(r,n,i){var c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(r,i);case 2:return(c=e.sent).size>n&&t(c,i),e.abrupt("return",c);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function n(t,e){var r,n;!function(t){for(var e=!1,r=document.getElementsByTagName("script"),n=new Set,o=0;o<r.length;o++){var i=r[o].getAttribute("src");i&&i===t&&(n.has(i)?e=!0:n.add(i))}return 0!==n.size&&e}(t)&&(r=document.createElement("script"),n=document.getElementsByTagName("head")[0],r.type="text/javascript",r.charset="UTF-8",r.src=t,window.onerror=function(){console.log("loadJavaScript加载".concat(t,"失败"))},r.addEventListener?r.addEventListener("load",(function(){e()}),!1):r.attachEvent&&r.attachEvent("onreadystatechange",(function(){"loaded"!==window.event.srcElement.readyState&&"complate"!==r.readState||e()})),r.addEventListener("error",(function(t){!function(t){if(null==t||"string"==typeof t&&(""===t||"undefined"===t||"null"===t)||Array.isArray(t)&&0===t.length||"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length)return 1}(t)&&e("err")})),t)&&n.appendChild(r)}return window.axios||n("https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js",(function(){console.log("axios 加载成功")})),window.AWS||n("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js",(function(){console.log("aws-sdk 加载成功")})),window.COS||n("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js",(function(){console.log("腾讯cos 加载成功")})),window.lrz||n("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js",(function(){console.log("lrz加载成功")})),{upload:function(t,e){var r,n,o,i=t.file,c=t.target,a=void 0===(a=t.project)?"0":a,s=t.keyFunc,l=t.needWholeRes;if(t=location.origin.includes("https://smnguat.fhrons.net")||location.origin.includes("https://openuat.fhrons.net")||process.env.VUE_APP_ENV_CONFIG&&process.env.VUE_APP_ENV_CONFIG.includes("hk")||"poc"===process.env.VUE_APP_ENV_CONFIG?"amazon":"tencent",c=c||t,i)return c="tencent"===c?"0":"1",r=(i=i.raw?i.raw:i).name,n=process.env.VUE_APP_NAME||"common",o=function(t){return t.startsWith("/")?t.substring(1):t}(o=(s="function"!=typeof s?function(){return"/"+n+"/uploadfile_"+(new Date).valueOf()+r}:s)()),axios.get("/funapi/config/oss/sign/".concat(c,"/").concat(a)).then((function(t){var r=t.data||t,n=r.tmpSecretId,c=r.tmpSecretKey,a=r.token,s=r.sessionToken,f=r.startTime,p=r.expiredTime,h=r.requestId,y=r.type,d=r.bucketName,v=r.region,g=r.cdnUrl;return"1"===y?(AWS.config.update({accessKeyId:n,secretAccessKey:c,region:v,sessionToken:a}),r=new AWS.S3,y={Bucket:d,Key:o,ContentType:y,Body:i,"Access-Control-Allow-Credentials":"*"},(r=r.upload(y)).on("httpUploadProgress",(function(t){var r=t.loaded;t=t.total,r=Math.round(100*parseInt(r/t)),"function"==typeof e&&e(r)})),r.promise().then((function(t){var e=t.key,r=t.Key;return console.log(t),l?u(u({},t),{},{fileUrl:"".concat(g,"/").concat(e||r)}):"".concat(g,"/").concat(e||r)})).catch((function(t){console.log(t)})).finally((function(t){}))):new COS({getAuthorization:function(t,e){e({TmpSecretId:n,TmpSecretKey:c,XCosSecurityToken:s,StartTime:f,ExpiredTime:p,requestId:h,SecurityToken:a})}}).sliceUploadFile({Bucket:d,Region:v,Key:o,StorageClass:"STANDARD",Body:i,onProgress:function(t){console.log(t),t.loaded,t.total;var r=t.percent;t.speed,t=Math.round(parseInt(100*r)),"function"==typeof e&&e(t)}}).then((function(e){console.log(e);var r=e.key,n=(e=e.Key).startsWith("/")?"":"/";return l?u(u({},t),{},{fileUrl:"".concat(g).concat(n).concat(r||e)}):"".concat(g).concat(n).concat(r||e)})).catch((function(t){console.log(t)}))}));console.error("上传的文件不能为空")},compressFile:t,loopCompressFile:function(t,e,n){return r.apply(this,arguments)}}},"object"===s(e)?t.exports=n():void 0!==(r=n.call(e,r,e,t))&&(t.exports=r)}},e={},function r(n){var o=e[n];return void 0===o&&(o=e[n]={exports:{}},t[n].call(o.exports,o,o.exports,r)),o.exports}(394);var t,e})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FHUpload=e():t.FHUpload=e()}(this,(()=>{return t={394:function(t,e,r){var n;function o(){"use strict";o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c=(j="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",a=j.asyncIterator||"@@asyncIterator",u=j.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(e,r,n,o){var c,a,u,s;return r=r&&r.prototype instanceof m?r:m,r=Object.create(r.prototype),o=new _(o||[]),i(r,"_invoke",{value:(c=e,a=n,u=o,s=h,function(e,r){if(s===d)throw Error("Generator is already running");if(s===v){if("throw"===e)throw r;return{value:t,done:!0}}for(u.method=e,u.arg=r;;){var n=u.delegate;if(n&&(n=function e(r,n){var o=n.method,i=r.iterator[o];return i===t?(n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g):"throw"===(o=p(i,r.iterator,n.arg)).type?(n.method="throw",n.arg=o.arg,n.delegate=null,g):(i=o.arg)?i.done?(n[r.resultName]=i.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,u),n)){if(n===g)continue;return n}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(s===h)throw s=v,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(s=d,"normal"===(n=p(c,a,u)).type){if(s=u.done?v:y,n.arg===g)continue;return{value:n.arg,done:u.done}}"throw"===n.type&&(s=v,u.method="throw",u.arg=n.arg)}})}),r}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",y="suspendedYield",d="executing",v="completed",g={};function m(){}function w(){}function b(){}var j,x,E=(l(j={},c,(function(){return this})),(x=(x=Object.getPrototypeOf)&&x(x(k([]))))&&x!==r&&n.call(x,c)&&(j=x),b.prototype=m.prototype=Object.create(j));function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){var r;i(this,"_invoke",{value:function(o,i){function c(){return new e((function(r,c){!function r(o,i,c,a){var u;if("throw"!==(o=p(t[o],t,i)).type)return(i=(u=o.arg).value)&&"object"==s(i)&&n.call(i,"__await")?e.resolve(i.__await).then((function(t){r("next",t,c,a)}),(function(t){r("throw",t,c,a)})):e.resolve(i).then((function(t){u.value=t,c(u)}),(function(t){return r("throw",t,c,a)}));a(o.arg)}(o,i,r,c)}))}return r=r?r.then(c,c):c()}})}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function k(e){if(e||""===e){var r,o=e[c];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(o=function o(){for(;++r<e.length;)if(n.call(e,r))return o.value=e[r],o.done=!1,o;return o.value=t,o.done=!0,o}).next=o}throw new TypeError(s(e)+" is not iterable")}return i(E,"constructor",{value:w.prototype=b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},O(S.prototype),l(S.prototype,a,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var c=new S(f(t,r,n,o),i);return e.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},O(E),l(E,u,"Generator"),l(E,c,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},e.values=k,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;0<=i;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var u=n.call(c,"catchLoc"),s=n.call(c,"finallyLoc");if(u&&s){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(u){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}var c=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,L(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var c=t.apply(e,r);function a(t){i(c,n,o,a,u,"next",t)}function u(t){i(c,n,o,a,u,"throw",t)}a(void 0)}))}}function a(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)),n}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){var n,o;n=t,o=r[e],(e=function(t){return t=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return String(t);if("object"!=s(r=r.call(t,"string")))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"==s(t)?t:t+""}(e))in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n=function(){function t(t,r){return e.apply(this,arguments)}function e(){return(e=c(o().mark((function t(e,r){var n,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=e.raw||e,t.prev=1,n="",t.next=5,lrz(e,{quality:r});case 5:return i=t.sent,n=new File([i.file],e.name,{type:"image/jpeg",lastModified:Date.now()}),t.abrupt("return",n);case 10:return t.prev=10,t.t0=t.catch(1),t.abrupt("return","");case 13:case"end":return t.stop()}}),t,null,[[1,10]])})))).apply(this,arguments)}function r(){return(r=c(o().mark((function e(r,n,i){var c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(r,i);case 2:return(c=e.sent).size>n&&t(c,i),e.abrupt("return",c);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function n(t,e){var r,n;!function(t){for(var e=!1,r=document.getElementsByTagName("script"),n=new Set,o=0;o<r.length;o++){var i=r[o].getAttribute("src");i&&i===t&&(n.has(i)?e=!0:n.add(i))}return 0!==n.size&&e}(t)&&(r=document.createElement("script"),n=document.getElementsByTagName("head")[0],r.type="text/javascript",r.charset="UTF-8",r.src=t,window.onerror=function(){console.log("loadJavaScript加载".concat(t,"失败"))},r.addEventListener?r.addEventListener("load",(function(){e()}),!1):r.attachEvent&&r.attachEvent("onreadystatechange",(function(){"loaded"!==window.event.srcElement.readyState&&"complate"!==r.readState||e()})),r.addEventListener("error",(function(t){!function(t){if(null==t||"string"==typeof t&&(""===t||"undefined"===t||"null"===t)||Array.isArray(t)&&0===t.length||"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length)return 1}(t)&&e("err")})),t)&&n.appendChild(r)}return window.axios||n("https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js",(function(){console.log("axios 加载成功")})),window.AWS||n("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js",(function(){console.log("aws-sdk 加载成功")})),window.COS||n("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js",(function(){console.log("腾讯cos 加载成功")})),window.lrz||n("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js",(function(){console.log("lrz加载成功")})),{upload:function(t,e){var r,n,o,i=t.file,c=t.target,a=void 0===(a=t.project)?"0":a,s=t.keyFunc,l=t.needWholeRes;if(t=location.origin.includes("https://smnguat.fhrons.net")||location.origin.includes("https://openuat.fhrons.net")||location.origin.includes("https://smng.avantech.io")||location.origin.includes("https://open.avantech.io")||process.env.VUE_APP_ENV_CONFIG&&process.env.VUE_APP_ENV_CONFIG.includes("hk")||process.env.VUE_APP_ENV_CONFIG&&"poc"===process.env.VUE_APP_ENV_CONFIG?"amazon":"tencent",c=c||t,i)return c="tencent"===c?"0":"1",r=(i=i.raw?i.raw:i).name,n=process.env.VUE_APP_NAME||"common",o=function(t){return t.startsWith("/")?t.substring(1):t}(o=(s="function"!=typeof s?function(){return"/"+n+"/uploadfile_"+(new Date).valueOf()+r}:s)()),axios.get("/funapi/config/oss/sign/".concat(c,"/").concat(a)).then((function(t){var r=t.data||t,n=r.tmpSecretId,c=r.tmpSecretKey,a=r.token,s=r.sessionToken,f=r.startTime,p=r.expiredTime,h=r.requestId,y=r.type,d=r.bucketName,v=r.region,g=r.cdnUrl;return"1"===y?(AWS.config.update({accessKeyId:n,secretAccessKey:c,region:v,sessionToken:a}),r=new AWS.S3,y={Bucket:d,Key:o,ContentType:y,Body:i,"Access-Control-Allow-Credentials":"*"},(r=r.upload(y)).on("httpUploadProgress",(function(t){var r=t.loaded;t=t.total,r=Math.round(100*parseInt(r/t)),"function"==typeof e&&e(r)})),r.promise().then((function(t){var e=t.key,r=t.Key;return console.log(t),l?u(u({},t),{},{fileUrl:"".concat(g,"/").concat(e||r)}):"".concat(g,"/").concat(e||r)})).catch((function(t){console.log(t)})).finally((function(t){}))):new COS({getAuthorization:function(t,e){e({TmpSecretId:n,TmpSecretKey:c,XCosSecurityToken:s,StartTime:f,ExpiredTime:p,requestId:h,SecurityToken:a})}}).sliceUploadFile({Bucket:d,Region:v,Key:o,StorageClass:"STANDARD",Body:i,onProgress:function(t){console.log(t),t.loaded,t.total;var r=t.percent;t.speed,t=Math.round(parseInt(100*r)),"function"==typeof e&&e(t)}}).then((function(e){console.log(e);var r=e.key,n=(e=e.Key).startsWith("/")?"":"/";return l?u(u({},t),{},{fileUrl:"".concat(g).concat(n).concat(r||e)}):"".concat(g).concat(n).concat(r||e)})).catch((function(t){console.log(t)}))}));console.error("上传的文件不能为空")},compressFile:t,loopCompressFile:function(t,e,n){return r.apply(this,arguments)}}},"object"===s(e)?t.exports=n():void 0!==(r=n.call(e,r,e,t))&&(t.exports=r)}},e={},function r(n){var o=e[n];return void 0===o&&(o=e[n]={exports:{}},t[n].call(o.exports,o,o.exports,r)),o.exports}(394);var t,e})); |
{ | ||
"name": "fhupload", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "泛华前端的上传方法", | ||
@@ -18,3 +18,4 @@ "main": "dist/fhupload.min.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "npx webpack --config webpack.config.js" | ||
}, | ||
@@ -21,0 +22,0 @@ "author": "", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13588