(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-commons"],{c32f:function(t,e,i){"use strict";var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.showBox,expression:"showBox"}],class:"pop"==t.mode?"mask":""},[i("div",{class:"pop"==t.mode?"verifybox":"",style:{"max-width":parseInt(t.imgSize.width)+30+"px"}},["pop"==t.mode?i("div",{staticClass:"verifybox-top"},[t._v(" 请完成安全验证 "),i("span",{staticClass:"verifybox-close",on:{click:t.closeBox}},[i("i",{staticClass:"iconfont icon-close"})])]):t._e(),i("div",{staticClass:"verifybox-bottom",style:{padding:"pop"==t.mode?"15px":"0"}},[t.componentType?i(t.componentType,{ref:"instance",tag:"components",attrs:{captchaType:t.captchaType,type:t.verifyType,figure:t.figure,arith:t.arith,mode:t.mode,vSpace:t.vSpace,explain:t.explain,imgSize:t.imgSize,blockSize:t.blockSize,barSize:t.barSize,defaultImg:t.defaultImg}}):t._e()],1)])])},o=[],r=(i("a9e3"),i("a15b"),i("d3b7"),i("25f0"),function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticStyle:{position:"relative"}},["2"===t.type?i("div",{staticClass:"verify-img-out",style:{height:parseInt(t.setSize.imgHeight)+t.vSpace+"px"}},[i("div",{staticClass:"verify-img-panel",style:{width:t.setSize.imgWidth,height:t.setSize.imgHeight}},[i("img",{staticStyle:{width:"100%",height:"100%",display:"block"},attrs:{src:t.backImgBase?"data:image/png;base64,"+t.backImgBase:t.defaultImg,alt:""}}),i("div",{directives:[{name:"show",rawName:"v-show",value:t.showRefresh,expression:"showRefresh"}],staticClass:"verify-refresh",on:{click:t.refresh}},[i("i",{staticClass:"iconfont icon-refresh"})]),i("transition",{attrs:{name:"tips"}},[t.tipWords?i("span",{staticClass:"verify-tips",class:t.passFlag?"suc-bg":"err-bg"},[t._v(t._s(t.tipWords))]):t._e()])],1)]):t._e(),i("div",{staticClass:"verify-bar-area",style:{width:t.setSize.imgWidth,height:t.barSize.height,"line-height":t.barSize.height}},[i("span",{staticClass:"verify-msg",domProps:{textContent:t._s(t.text)}}),i("div",{staticClass:"verify-left-bar",style:{width:void 0!==t.leftBarWidth?t.leftBarWidth:t.barSize.height,height:t.barSize.height,"border-color":t.leftBarBorderColor,transaction:t.transitionWidth}},[i("span",{staticClass:"verify-msg",domProps:{textContent:t._s(t.finishText)}}),i("div",{staticClass:"verify-move-block",style:{width:t.barSize.height,height:t.barSize.height,"background-color":t.moveBlockBackgroundColor,left:t.moveBlockLeft,transition:t.transitionLeft},on:{touchstart:t.start,mousedown:t.start}},[i("i",{class:["verify-icon iconfont",t.iconClass],style:{color:t.iconColor}}),"2"===t.type?i("div",{staticClass:"verify-sub-block",style:{width:Math.floor(47*parseInt(t.setSize.imgWidth)/310)+"px",height:t.setSize.imgHeight,top:"-"+(parseInt(t.setSize.imgHeight)+t.vSpace)+"px","background-size":t.setSize.imgWidth+" "+t.setSize.imgHeight}},[i("img",{staticStyle:{width:"100%",height:"100%",display:"block"},attrs:{src:"data:image/png;base64,"+t.blockBackImgBase,alt:""}})]):t._e()])])])])}),n=[],a=(i("ac1f"),i("5319"),i("e9c4"),i("b680"),i("3452")),c=i.n(a);function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"XwKsGlMcdPMEhR1B",i=c.a.enc.Utf8.parse(e),s=c.a.enc.Utf8.parse(t),o=c.a.AES.encrypt(s,i,{mode:c.a.mode.ECB,padding:c.a.pad.Pkcs7});return o.toString()}function l(t){var e,i,s,o,r=t.$el.parentNode.offsetWidth||window.offsetWidth,n=t.$el.parentNode.offsetHeight||window.offsetHeight;return e=-1!=t.imgSize.width.indexOf("%")?parseInt(this.imgSize.width)/100*r+"px":this.imgSize.width,i=-1!=t.imgSize.height.indexOf("%")?parseInt(this.imgSize.height)/100*n+"px":this.imgSize.height,s=-1!=t.barSize.width.indexOf("%")?parseInt(this.barSize.width)/100*r+"px":this.barSize.width,o=-1!=t.barSize.height.indexOf("%")?parseInt(this.barSize.height)/100*n+"px":this.barSize.height,{imgWidth:e,imgHeight:i,barWidth:s,barHeight:o}}var d=i("b775");function p(t){return Object(d["a"])({url:"/captcha/get",method:"post",data:t})}function f(t){return Object(d["a"])({url:"/captcha/check",method:"post",data:t})}var u={name:"VerifySlide",props:{captchaType:{type:String},type:{type:String,default:"1"},mode:{type:String,default:"fixed"},vSpace:{type:Number,default:5},explain:{type:String,default:"向右滑动完成验证"},imgSize:{type:Object,default:function(){return{width:"310px",height:"155px"}}},blockSize:{type:Object,default:function(){return{width:"50px",height:"50px"}}},barSize:{type:Object,default:function(){return{width:"310px",height:"40px"}}},defaultImg:{type:String,default:""}},data:function(){return{secretKey:"",passFlag:"",backImgBase:"",blockBackImgBase:"",backToken:"",startMoveTime:"",endMovetime:"",tipsBackColor:"",tipWords:"",text:"",finishText:"",setSize:{imgHeight:0,imgWidth:0,barHeight:0,barWidth:0},top:0,left:0,moveBlockLeft:void 0,leftBarWidth:void 0,moveBlockBackgroundColor:void 0,leftBarBorderColor:"#ddd",iconColor:void 0,iconClass:"icon-right",status:!1,isEnd:!1,showRefresh:!0,transitionLeft:"",transitionWidth:""}},computed:{barArea:function(){return this.$el.querySelector(".verify-bar-area")},resetSize:function(){return l}},methods:{init:function(){var t=this;this.text=this.explain,this.getPictrue(),this.$nextTick((function(){var e=t.resetSize(t);for(var i in e)t.$set(t.setSize,i,e[i]);t.$parent.$emit("ready",t)}));var e=this;window.removeEventListener("touchmove",(function(t){e.move(t)})),window.removeEventListener("mousemove",(function(t){e.move(t)})),window.removeEventListener("touchend",(function(){e.end()})),window.removeEventListener("mouseup",(function(){e.end()})),window.addEventListener("touchmove",(function(t){e.move(t)})),window.addEventListener("mousemove",(function(t){e.move(t)})),window.addEventListener("touchend",(function(){e.end()})),window.addEventListener("mouseup",(function(){e.end()}))},start:function(t){if(t=t||window.event,t.touches)e=t.touches[0].pageX;else var e=t.clientX;this.startLeft=Math.floor(e-this.barArea.getBoundingClientRect().left),this.startMoveTime=+new Date,0==this.isEnd&&(this.text="",this.moveBlockBackgroundColor="#337ab7",this.leftBarBorderColor="#337AB7",this.iconColor="#fff",t.stopPropagation(),this.status=!0)},move:function(t){if(t=t||window.event,this.status&&0==this.isEnd){if(t.touches)e=t.touches[0].pageX;else var e=t.clientX;var i=this.barArea.getBoundingClientRect().left,s=e-i;s>=this.barArea.offsetWidth-parseInt(parseInt(this.blockSize.width)/2)-2&&(s=this.barArea.offsetWidth-parseInt(parseInt(this.blockSize.width)/2)-2),s<=0&&(s=parseInt(parseInt(this.blockSize.width)/2)),this.moveBlockLeft=s-this.startLeft+"px",this.leftBarWidth=s-this.startLeft+"px"}},end:function(){var t=this;this.endMovetime=+new Date;var e=this;if(this.status&&0==this.isEnd){var i=parseInt((this.moveBlockLeft||"").replace("px",""));i=310*i/parseInt(this.setSize.imgWidth);var s={captchaType:this.captchaType,pointJson:this.secretKey?h(JSON.stringify({x:i,y:5}),this.secretKey):JSON.stringify({x:i,y:5}),token:this.backToken};f(s).then((function(s){if("0000"==s.repCode){t.moveBlockBackgroundColor="#5cb85c",t.leftBarBorderColor="#5cb85c",t.iconColor="#fff",t.iconClass="icon-check",t.showRefresh=!1,t.isEnd=!0,t.passFlag=!0,t.tipWords="".concat(((t.endMovetime-t.startMoveTime)/1e3).toFixed(2),"s验证成功");var o=t.secretKey?h(t.backToken+"---"+JSON.stringify({x:i,y:5}),t.secretKey):t.backToken+"---"+JSON.stringify({x:i,y:5});setTimeout((function(){t.tipWords="",t.$parent.closeBox(),t.$parent.$emit("success",{captchaVerification:o})}),1e3)}else t.moveBlockBackgroundColor="#d9534f",t.leftBarBorderColor="#d9534f",t.iconColor="#fff",t.iconClass="icon-close",t.passFlag=!1,setTimeout((function(){e.refresh()}),1e3),t.$parent.$emit("error",t),t.tipWords="验证失败",setTimeout((function(){t.tipWords=""}),1e3)})),this.status=!1}},refresh:function(){var t=this;this.showRefresh=!0,this.finishText="",this.transitionLeft="left .3s",this.moveBlockLeft=0,this.leftBarWidth=void 0,this.transitionWidth="width .3s",this.leftBarBorderColor="#ddd",this.moveBlockBackgroundColor="#fff",this.iconColor="#000",this.iconClass="icon-right",this.isEnd=!1,this.getPictrue(),setTimeout((function(){t.transitionWidth="",t.transitionLeft="",t.text=t.explain}),300)},getPictrue:function(){var t=this,e={captchaType:this.captchaType,clientUid:localStorage.getItem("slider"),ts:Date.now()};p(e).then((function(e){"0000"==e.repCode?(t.backImgBase=e.repData.originalImageBase64,t.blockBackImgBase=e.repData.jigsawImageBase64,t.backToken=e.repData.token,t.secretKey=e.repData.secretKey):t.tipWords=e.repMsg,"6201"==e.repCode&&(t.backImgBase=null,t.blockBackImgBase=null)}))}},watch:{type:{immediate:!0,handler:function(){this.init()}}},mounted:function(){this.$el.onselectstart=function(){return!1}}},g=u,m=i("2877"),v=Object(m["a"])(g,r,n,!1,null,null,null),y=v.exports,b=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticStyle:{position:"relative"}},[i("div",{staticClass:"verify-img-out"},[i("div",{staticClass:"verify-img-panel",style:{width:t.setSize.imgWidth,height:t.setSize.imgHeight,"background-size":t.setSize.imgWidth+" "+t.setSize.imgHeight,"margin-bottom":t.vSpace+"px"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.showRefresh,expression:"showRefresh"}],staticClass:"verify-refresh",staticStyle:{"z-index":"3"},on:{click:t.refresh}},[i("i",{staticClass:"iconfont icon-refresh"})]),i("img",{ref:"canvas",staticStyle:{width:"100%",height:"100%",display:"block"},attrs:{src:t.pointBackImgBase?"data:image/png;base64,"+t.pointBackImgBase:t.defaultImg,alt:""},on:{click:function(e){t.bindingClick&&t.canvasClick(e)}}}),t._l(t.tempPoints,(function(e,s){return i("div",{key:s,staticClass:"point-area",style:{"background-color":"#1abd6c",color:"#fff","z-index":9999,width:"20px",height:"20px","text-align":"center","line-height":"20px","border-radius":"50%",position:"absolute",top:parseInt(e.y-10)+"px",left:parseInt(e.x-10)+"px"}},[t._v(" "+t._s(s+1)+" ")])}))],2)]),i("div",{staticClass:"verify-bar-area",style:{width:t.setSize.imgWidth,color:this.barAreaColor,"border-color":this.barAreaBorderColor,"line-height":this.barSize.height}},[i("span",{staticClass:"verify-msg"},[t._v(t._s(t.text))])])])},k=[],S=(i("a434"),i("14d9"),i("d81d"),{name:"VerifyPoints",props:{mode:{type:String,default:"fixed"},captchaType:{type:String},vSpace:{type:Number,default:5},imgSize:{type:Object,default:function(){return{width:"310px",height:"155px"}}},barSize:{type:Object,default:function(){return{width:"310px",height:"40px"}}},defaultImg:{type:String,default:""}},data:function(){return{secretKey:"",checkNum:3,fontPos:[],checkPosArr:[],num:1,pointBackImgBase:"",poinTextList:[],backToken:"",setSize:{imgHeight:0,imgWidth:0,barHeight:0,barWidth:0},tempPoints:[],text:"",barAreaColor:void 0,barAreaBorderColor:void 0,showRefresh:!0,bindingClick:!0}},computed:{resetSize:function(){return l}},methods:{init:function(){var t=this;this.fontPos.splice(0,this.fontPos.length),this.checkPosArr.splice(0,this.checkPosArr.length),this.num=1,this.getPictrue(),this.$nextTick((function(){t.setSize=t.resetSize(t),t.$parent.$emit("ready",t)}))},canvasClick:function(t){var e=this;this.checkPosArr.push(this.getMousePos(this.$refs.canvas,t)),this.num==this.checkNum&&(this.num=this.createPoint(this.getMousePos(this.$refs.canvas,t)),this.checkPosArr=this.pointTransfrom(this.checkPosArr,this.setSize),setTimeout((function(){var t=e.secretKey?h(e.backToken+"---"+JSON.stringify(e.checkPosArr),e.secretKey):e.backToken+"---"+JSON.stringify(e.checkPosArr),i={captchaType:e.captchaType,pointJson:e.secretKey?h(JSON.stringify(e.checkPosArr),e.secretKey):JSON.stringify(e.checkPosArr),token:e.backToken};f(i).then((function(i){"0000"==i.repCode?(e.barAreaColor="#4cae4c",e.barAreaBorderColor="#5cb85c",e.text="验证成功",e.bindingClick=!1,"pop"==e.mode&&setTimeout((function(){e.$parent.clickShow=!1,e.refresh()}),1500),e.$parent.$emit("success",{captchaVerification:t})):(e.$parent.$emit("error",e),e.barAreaColor="#d9534f",e.barAreaBorderColor="#d9534f",e.text="验证失败",setTimeout((function(){e.refresh()}),700))}))}),400)),this.num<this.checkNum&&(this.num=this.createPoint(this.getMousePos(this.$refs.canvas,t)))},getMousePos:function(t,e){var i=e.offsetX,s=e.offsetY;return{x:i,y:s}},createPoint:function(t){return this.tempPoints.push(Object.assign({},t)),++this.num},refresh:function(){this.tempPoints.splice(0,this.tempPoints.length),this.barAreaColor="#000",this.barAreaBorderColor="#ddd",this.bindingClick=!0,this.fontPos.splice(0,this.fontPos.length),this.checkPosArr.splice(0,this.checkPosArr.length),this.num=1,this.getPictrue(),this.text="验证失败",this.showRefresh=!0},getPictrue:function(){var t=this,e={captchaType:this.captchaType,clientUid:localStorage.getItem("point"),ts:Date.now()};p(e).then((function(e){"0000"==e.repCode?(t.pointBackImgBase=e.repData.originalImageBase64,t.backToken=e.repData.token,t.secretKey=e.repData.secretKey,t.poinTextList=e.repData.wordList,t.text="请依次点击【"+t.poinTextList.join(",")+"】"):t.text=e.repMsg,"6201"==e.repCode&&(t.pointBackImgBase=null)}))},pointTransfrom:function(t,e){var i=t.map((function(t){var i=Math.round(310*t.x/parseInt(e.imgWidth)),s=Math.round(155*t.y/parseInt(e.imgHeight));return{x:i,y:s}}));return i}},watch:{type:{immediate:!0,handler:function(){this.init()}}},mounted:function(){this.$el.onselectstart=function(){return!1}}}),w=S,x=Object(m["a"])(w,b,k,!1,null,null,null),B=x.exports,C={name:"Vue2Verify",props:{locale:{require:!1,type:String,default:function(){if(navigator.language)var t=navigator.language;else t=navigator.browserLanguage;return t}},captchaType:{type:String,required:!0},figure:{type:Number},arith:{type:Number},mode:{type:String,default:"pop"},vSpace:{type:Number},explain:{type:String},imgSize:{type:Object,default:function(){return{width:"310px",height:"155px"}}},blockSize:{type:Object},barSize:{type:Object}},data:function(){return{clickShow:!1,verifyType:void 0,componentType:void 0,defaultImg:i("951a")}},mounted:function(){this.uuid()},methods:{uuid:function(){for(var t=[],e="0123456789abcdef",i=0;i<36;i++)t[i]=e.substr(Math.floor(16*Math.random()),1);t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-";var s="slider-"+t.join(""),o="point-"+t.join("");localStorage.getItem("slider")||localStorage.setItem("slider",s),localStorage.getItem("point")||localStorage.setItem("point",o)},i18n:function(t){if(this.$t)return this.$t(t);var e=this.$options.i18n.messages[this.locale]||this.$options.i18n.messages["en-US"];return e[t]},refresh:function(){this.instance.refresh&&this.instance.refresh()},closeBox:function(){this.clickShow=!1,this.refresh()},show:function(){"pop"==this.mode&&(this.clickShow=!0)}},computed:{instance:function(){return this.$refs.instance||{}},showBox:function(){return"pop"!=this.mode||this.clickShow}},watch:{captchaType:{immediate:!0,handler:function(t){switch(t.toString()){case"blockPuzzle":this.verifyType="2",this.componentType="VerifySlide";break;case"clickWord":this.verifyType="",this.componentType="VerifyPoints";break}}}},components:{VerifySlide:y,VerifyPoints:B}},z=C,T=(i("fe82"),Object(m["a"])(z,s,o,!1,null,null,null));e["a"]=T.exports},ceaa:function(t,e,i){},fe82:function(t,e,i){"use strict";i("ceaa")}}]);