"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[3479],{1980:function(e,t,n){var o=n(4165),c=n(5861),a=n(2954),r=n.n(a),s=n(2495),i=n(6189);t.Z=function(){var e=(0,i.C)(),t=e.fetchData,n=(e.state,function uploadCDNImg(e,n,a){var i=e.path;return console.log("filetype::",i),function getFileType(e){return!!e&&(RegExp(".?(".concat(["gif","jpeg","jpg","bmp","png"].join("|"),")$"),"i").test(e.toLowerCase())?"image":!!RegExp(".(".concat(["avi","wmv","mkv","mp4","mov","rm","3gp","flv","mpg","rmvb","quicktime"].join("|"),")$"),"i").test(e.toLowerCase())&&"video")}(i)?new Promise((function(a,i){(function getSecret(e,n){return new Promise(function(){var n=(0,c.Z)((0,o.Z)().mark((function _callee(n,c){var a,r,s;return(0,o.Z)().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return a="/".concat(e,"/{filemd5}{day}{hour}{min}{sec}{.suffix}"),r={method:"post",save_key:a},o.next=4,t(r);case 4:(s=o.sent).success?n(s.data):c({code:s.code||"9999",msg:s.msg});case 6:case"end":return o.stop()}}),_callee)})));return function(e,t){return n.apply(this,arguments)}}())})(n).then((function(t){var n=t;console.log("bucket",n.bucket);var o={authorization:n.authorization,policy:n.policy},c=r().uploadFile({url:"".concat(s.Fu).concat(n.bucket),formData:o,filePath:e.path,name:"file",success:function success(e){a(JSON.parse("".concat(e.data)))},fail:function fail(e){console.log(e),i(e)}});c.progress((function(e){console.log("上传进度",e.progress),e.progress<100?r().showLoading({title:"上传中..."}):r().hideLoading()}))})).catch((function(e){i(e),r().showToast({title:"获取密钥失败!",icon:"none",duration:3800})}))})):(r().showToast({title:"上传文件类型错误",icon:"none",duration:3800}),!1)});return{uploadCDNImg:n,getWxPhoto:function getWxPhoto(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(a,s){var i=[];r().chooseImage({count:t,sizeType:["original","compressed"],sourceType:["album","camera"],success:function success(r){return(0,c.Z)((0,o.Z)().mark((function _callee2(){var c,u,l;return(0,o.Z)().wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,!(t>1)){o.next=14;break}c=0;case 3:if(!(c