Comparing version 1.0.12 to 1.0.13
@@ -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()}(this,(()=>{return t={394:function(t,e,n){var r;function o(){"use strict";o=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},c=(j="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",a=j.asyncIterator||"@@asyncIterator",u=j.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function f(e,n,r,o){var c,a,u,s;return n=n&&n.prototype instanceof m?n:m,n=Object.create(n.prototype),o=new _(o||[]),i(n,"_invoke",{value:(c=e,a=r,u=o,s=h,function(e,n){if(s===y)throw Error("Generator is already running");if(s===v){if("throw"===e)throw n;return{value:t,done:!0}}for(u.method=e,u.arg=n;;){var r=u.delegate;if(r&&(r=function e(n,r){var o=r.method,i=n.iterator[o];return i===t?(r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=t,e(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g):"throw"===(o=p(i,n.iterator,r.arg)).type?(r.method="throw",r.arg=o.arg,r.delegate=null,g):(i=o.arg)?i.done?(r[n.resultName]=i.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}(r,u),r)){if(r===g)continue;return r}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=y,"normal"===(r=p(c,a,u)).type){if(s=u.done?v:d,r.arg===g)continue;return{value:r.arg,done:u.done}}"throw"===r.type&&(s=v,u.method="throw",u.arg=r.arg)}})}),n}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="suspendedYield",y="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!==n&&r.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 n;i(this,"_invoke",{value:function(o,i){function c(){return new e((function(n,c){!function n(o,i,c,a){var u;if("throw"!==(o=p(t[o],t,i)).type)return(i=(u=o.arg).value)&&"object"==s(i)&&r.call(i,"__await")?e.resolve(i.__await).then((function(t){n("next",t,c,a)}),(function(t){n("throw",t,c,a)})):e.resolve(i).then((function(t){u.value=t,c(u)}),(function(t){return n("throw",t,c,a)}));a(o.arg)}(o,i,n,c)}))}return n=n?n.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 n,o=e[c];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(o=function o(){for(;++n<e.length;)if(r.call(e,n))return o.value=e[n],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,n,r,o,i){void 0===i&&(i=Promise);var c=new S(f(t,n,r,o),i);return e.isGeneratorFunction(n)?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,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)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 n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.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=r.call(c,"catchLoc"),s=r.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 n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(n=o.completion).type&&(r=n.arg,L(o)),r}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,n,r,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,o)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var c=t.apply(e,n);function a(t){i(c,r,o,a,u,"next",t)}function u(t){i(c,r,o,a,u,"throw",t)}a(void 0)}))}}function a(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)),r}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){var r,o;r=t,o=n[e],(e=function(t){return t=function(t,e){if("object"!=s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return String(t);if("object"!=s(n=n.call(t,"string")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"==s(t)?t:t+""}(e))in r?Object.defineProperty(r,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[e]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,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)}r=function(){function t(t,n){return e.apply(this,arguments)}function e(){return(e=c(o().mark((function t(e,n){var r,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=e.raw||e,t.prev=1,r="",t.next=5,lrz(e,{quality:n});case 5:return i=t.sent,r=new File([i.file],e.name,{type:"image/jpeg",lastModified:Date.now()}),t.abrupt("return",r);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 n(){return(n=c(o().mark((function e(n,r,i){var c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(n,i);case 2:return(c=e.sent).size>r&&t(c,i),e.abrupt("return",c);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function r(t,e){var n,r;!function(t){for(var e=!1,n=document.getElementsByTagName("script"),r=new Set,o=0;o<n.length;o++){var i=n[o].getAttribute("src");i&&i===t&&(r.has(i)?e=!0:r.add(i))}return 0!==r.size&&e}(t)&&(n=document.createElement("script"),r=document.getElementsByTagName("head")[0],n.type="text/javascript",n.charset="UTF-8",n.src=t,window.onerror=function(){console.log("loadJavaScript加载".concat(t,"失败"))},n.addEventListener?n.addEventListener("load",(function(){e()}),!1):n.attachEvent&&n.attachEvent("onreadystatechange",(function(){"loaded"!==window.event.srcElement.readyState&&"complate"!==n.readState||e()})),n.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)&&r.appendChild(n)}window.axios||r("https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js",(function(){console.log("axios 加载成功")})),window.AWS||r("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js",(function(){console.log("aws-sdk 加载成功")})),window.COS||r("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js",(function(){console.log("腾讯cos 加载成功")})),window.lrz||r("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js",(function(){console.log("lrz加载成功")}));var i={upload:function(t,e){var n,r,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",n=(i=(i=i.raw?i.raw:i).file?i.file:i).name,r=process.env.VUE_APP_NAME||"common",o=function(t){return t.startsWith("/")?t.substring(1):t}(o=(s="function"!=typeof s?function(){return"/"+r+"/uploadfile_"+(new Date).valueOf()+n}:s)()),axios.get("/funapi/config/oss/sign/".concat(c,"/").concat(a)).then((function(t){var n=t.data||t,r=n.tmpSecretId,c=n.tmpSecretKey,a=n.token,s=n.sessionToken,f=n.startTime,p=n.expiredTime,h=n.requestId,d=n.type,y=n.bucketName,v=n.region,g=n.cdnUrl;return"1"===d?(AWS.config.update({accessKeyId:r,secretAccessKey:c,region:v,sessionToken:a}),n=new AWS.S3,d={Bucket:y,Key:o,ContentType:d,Body:i,"Access-Control-Allow-Credentials":"*"},(n=n.upload(d)).on("httpUploadProgress",(function(t){var n=t.loaded;t=t.total,n=Math.round(100*parseInt(n/t)),"function"==typeof e&&e(n)})),n.promise().then((function(t){var e=t.key,n=t.Key;return console.log(t),l?u(u({},t),{},{fileUrl:"".concat(g,"/").concat(e||n)}):"".concat(g,"/").concat(e||n)})).catch((function(t){console.log(t)})).finally((function(t){}))):new COS({getAuthorization:function(t,e){e({TmpSecretId:r,TmpSecretKey:c,XCosSecurityToken:s,StartTime:f,ExpiredTime:p,requestId:h,SecurityToken:a})}}).sliceUploadFile({Bucket:y,Region:v,Key:o,StorageClass:"STANDARD",Body:i,onProgress:function(t){console.log(t),t.loaded,t.total;var n=t.percent;t.speed,t=Math.round(parseInt(100*n)),"function"==typeof e&&e(t)}}).then((function(e){console.log(e);var n=e.key,r=(e=e.Key).startsWith("/")?"":"/";return l?u(u({},t),{},{fileUrl:"".concat(g).concat(r).concat(n||e)}):"".concat(g).concat(r).concat(n||e)})).catch((function(t){console.log(t)}))}));console.error("上传的文件不能为空")},compressFile:t,loopCompressFile:function(t,e,r){return n.apply(this,arguments)},install:function(){window.FHUpload=i}};return i},"object"===s(e)?t.exports=r():void 0!==(n=r.call(e,n,e,t))&&(t.exports=n)}},e={},function n(r){var o=e[r];return void 0===o&&(o=e[r]={exports:{}},t[r].call(o.exports,o,o.exports,n)),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=(x="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",a=x.asyncIterator||"@@asyncIterator",u=x.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===y)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=y,"normal"===(n=p(c,a,u)).type){if(s=u.done?v:d,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",d="suspendedYield",y="executing",v="completed",g={};function m(){}function w(){}function b(){}var x,E,j=(l(x={},c,(function(){return this})),(E=(E=Object.getPrototypeOf)&&E(E(k([]))))&&E!==r&&n.call(E,c)&&(x=E),b.prototype=m.prototype=Object.create(x));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(j,"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(j),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(j),l(j,u,"Generator"),l(j,c,(function(){return this})),l(j,"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){return e.apply(this,arguments)}function e(){return(e=c(o().mark((function t(e){var r,n,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=1<i.length&&void 0!==i[1]?i[1]:.7,e=e.raw||e,t.prev=2,r="",t.next=6,lrz(e,{quality:n});case 6:return n=t.sent,r=new File([n.file],e.name,{type:"image/jpeg",lastModified:Date.now()}),t.abrupt("return",r);case 11:return t.prev=11,t.t0=t.catch(2),t.abrupt("return","");case 14:case"end":return t.stop()}}),t,null,[[2,11]])})))).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:if(n)return e.abrupt("return",new Error("size 不能为空"));e.next=2;break;case 2:return e.next=4,t(r,i);case 4:return(c=e.sent).size>n&&t(c,i),e.abrupt("return",c);case 7: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)}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加载成功")}));var i={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=i.raw?i.raw:i).file?i.file: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"==typeof s&&!s()?function(){return"/"+n+"/"+(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,d=r.type,y=r.bucketName,v=r.region,g=r.cdnUrl;return"1"===d?(AWS.config.update({accessKeyId:n,secretAccessKey:c,region:v,sessionToken:a}),r=new AWS.S3,d={Bucket:y,Key:o,ContentType:d,Body:i,"Access-Control-Allow-Credentials":"*"},(r=r.upload(d)).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:y,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)},install:function(){window.FHUpload=i}};return i},"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.12", | ||
"version": "1.0.13", | ||
"description": "泛华前端的上传方法", | ||
@@ -5,0 +5,0 @@ "main": "dist/upload.min.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
26046
4
281