chunk-016ac595.ade13040.js 15 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-016ac595"],{"1b71":function(t,e,i){},"5d39":function(t,e,i){"use strict";var s=i("3452"),o=i.n(s);function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"XwKsGlMcdPMEhR1B",i=o.a.enc.Utf8.parse(e),s=o.a.enc.Utf8.parse(t);return o.a.AES.encrypt(s,i,{mode:o.a.mode.ECB,padding:o.a.pad.Pkcs7}).toString()}function r(t){var e=t.$el.parentNode.offsetWidth||window.offsetWidth,i=t.$el.parentNode.offsetHeight||window.offsetHeight;return{imgWidth:-1!=t.imgSize.width.indexOf("%")?parseInt(this.imgSize.width)/100*e+"px":this.imgSize.width,imgHeight:-1!=t.imgSize.height.indexOf("%")?parseInt(this.imgSize.height)/100*i+"px":this.imgSize.height,barWidth:-1!=t.barSize.width.indexOf("%")?parseInt(this.barSize.width)/100*e+"px":this.barSize.width,barHeight:-1!=t.barSize.height.indexOf("%")?parseInt(this.barSize.height)/100*i+"px":this.barSize.height}}var a=i("2934"),c={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 r}},watch:{type:{immediate:!0,handler:function(){this.init()}}},mounted:function(){this.$el.onselectstart=function(){return!1}},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).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=e-this.barArea.getBoundingClientRect().left;i>=this.barArea.offsetWidth-parseInt(parseInt(this.blockSize.width)/2)-2&&(i=this.barArea.offsetWidth-parseInt(parseInt(this.blockSize.width)/2)-2),i<=0&&(i=parseInt(parseInt(this.blockSize.width)/2)),this.moveBlockLeft=i-this.startLeft+"px",this.leftBarWidth=i-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?n(JSON.stringify({x:i,y:5}),this.secretKey):JSON.stringify({x:i,y:5}),token:this.backToken};Object(a.b)(s).then((function(e){t.moveBlockBackgroundColor="#5cb85c",t.leftBarBorderColor="#5cb85c",t.iconColor="#fff",t.iconClass="icon-check",t.showRefresh=!1,t.isEnd=!0,"pop"==t.mode&&setTimeout((function(){t.$parent.clickShow=!1,t.refresh()}),1500),t.passFlag=!0,t.tipWords="".concat(((t.endMovetime-t.startMoveTime)/1e3).toFixed(2),"s验证成功");var s=t.secretKey?n(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:s})}),1e3)})).catch((function(i){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()};Object(a.a)(e).then((function(e){t.backImgBase=e.data.originalImageBase64,t.blockBackImgBase=e.data.jigsawImageBase64,t.backToken=e.data.token,t.secretKey=e.data.secretKey})).catch((function(e){t.tipWords=e.msg,t.backImgBase=null,t.blockBackImgBase=null}))}}},h=i("2877"),l=Object(h.a)(c,(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()])])])])}),[],!1,null,null,null).exports,d={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 r}},watch:{type:{immediate:!0,handler:function(){this.init()}}},mounted:function(){this.$el.onselectstart=function(){return!1}},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?n(e.backToken+"---"+JSON.stringify(e.checkPosArr),e.secretKey):e.backToken+"---"+JSON.stringify(e.checkPosArr),i={captchaType:e.captchaType,pointJson:e.secretKey?n(JSON.stringify(e.checkPosArr),e.secretKey):JSON.stringify(e.checkPosArr),token:e.backToken};Object(a.b)(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){return{x:e.offsetX,y:e.offsetY}},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()};Object(a.a)(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){return t.map((function(t){return{x:Math.round(310*t.x/parseInt(e.imgWidth)),y:Math.round(155*t.y/parseInt(e.imgHeight))}}))}}},p={name:"Vue2Verify",components:{VerifySlide:l,VerifyPoints:Object(h.a)(d,(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("\n "+t._s(s+1)+"\n ")])}))],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))])])])}),[],!1,null,null,null).exports},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")}},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"}}}},mounted:function(){this.uuid()},methods:{uuid:function(){for(var t=[],e=0;e<36;e++)t[e]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);t[14]="4",t[19]="0123456789abcdef".substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-";var i="slider-"+t.join(""),s="point-"+t.join("");localStorage.getItem("slider")||localStorage.setItem("slider",i),localStorage.getItem("point")||localStorage.setItem("point",s)},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)}}},f=(i("abc9"),Object(h.a)(p,(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("\n 请完成安全验证\n "),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:{"captcha-type":t.captchaType,type:t.verifyType,figure:t.figure,arith:t.arith,mode:t.mode,"v-space":t.vSpace,explain:t.explain,"img-size":t.imgSize,"block-size":t.blockSize,"bar-size":t.barSize,"default-img":t.defaultImg}}):t._e()],1)])])}),[],!1,null,null,null));e.a=f.exports},"951a":function(t,e,i){t.exports=i.p+"view_admin/img/default.6b914f9c.jpg"},abc9:function(t,e,i){"use strict";var s=i("1b71");i.n(s).a}}]);