mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 13:22:51 +00:00
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2008e315"],{"318e":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page-account"},[n("div",{staticClass:"container",class:[e.fullWidth>768?"containerSamll":"containerBig"]},[e.fullWidth>768?n("swiper",{staticClass:"swiperPross",attrs:{options:e.swiperOption}},[e._l(e.swiperList,(function(e,t){return n("swiper-slide",{key:t,staticClass:"swiperPic"},[n("img",{attrs:{src:e.slide}})])})),n("div",{staticClass:"swiper-pagination",attrs:{slot:"pagination"},slot:"pagination"})],2):e._e(),n("div",{staticClass:"index_from page-account-container from-wh"},[n("div",{staticClass:"page-account-top"},[n("div",{staticClass:"page-account-top-logo"},[n("img",{staticStyle:{width:"100%",height:"74px"},attrs:{src:e.login_logo,alt:"logo"}})])]),n("Form",{ref:"formInline",attrs:{model:e.formInline,rules:e.ruleInline},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSubmit("formInline")}}},[n("FormItem",{attrs:{prop:"username"}},[n("Input",{attrs:{type:"text",prefix:"ios-contact-outline",placeholder:"请输入用户名",size:"large"},model:{value:e.formInline.username,callback:function(t){e.$set(e.formInline,"username",t)},expression:"formInline.username"}})],1),n("FormItem",{attrs:{prop:"password"}},[n("Input",{attrs:{type:"password",prefix:"ios-lock-outline",placeholder:"请输入密码",size:"large"},model:{value:e.formInline.password,callback:function(t){e.$set(e.formInline,"password",t)},expression:"formInline.password"}})],1),n("FormItem",{attrs:{prop:"code"}},[n("div",{staticClass:"code"},[n("Input",{attrs:{type:"text",prefix:"ios-keypad-outline",placeholder:"请输入验证码",size:"large"},model:{value:e.formInline.code,callback:function(t){e.$set(e.formInline,"code",t)},expression:"formInline.code"}}),n("img",{staticClass:"pictrue",attrs:{src:e.imgcode},on:{click:e.captchas}})],1)]),n("FormItem",[n("Button",{staticClass:"btn",attrs:{type:"primary",long:"",loading:e.loading,size:"large"},on:{click:function(t){return e.handleSubmit("formInline")}}},[e._v("登录")])],1)],1)],1)],1),n("Modal",{attrs:{scrollable:"","footer-hide":"",closable:"",title:"请完成安全校验","mask-closable":!1,"z-index":2,width:"342"},model:{value:e.modals,callback:function(t){e.modals=t},expression:"modals"}},[n("div",{staticClass:"captchaBox"},[n("div",{ref:"captcha",staticStyle:{position:"relative"},attrs:{id:"captcha"}}),n("div",{attrs:{id:"msg"}})])])],1)},o=[],s=(n("a481"),n("96cf"),n("3b8d")),a=(n("7f7f"),n("5723")),r=n("d708"),c=n("c276");n("ac6a");!function(){function e(e,t,n){return e.getAttribute(t)||n}function t(e){return document.getElementsByTagName(e)}function n(){var n=t("script"),i=n.length,o=n[i-1];return{l:i,z:e(o,"zIndex",-2),o:e(o,"opacity",.8),c:e(o,"color","255,255,255"),n:e(o,"count",240)}}function i(){s=r.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=r.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function o(){if(d+=1,d<5)m(o);else{d=0,u.clearRect(0,0,s,a);var e,t,n,i,r,l,f=[h].concat(p);p.forEach((function(o){for(o.x+=o.xa,o.y+=o.ya,o.xa*=o.x>s||o.x<0?-1:1,o.ya*=o.y>a||o.y<0?-1:1,u.fillRect(o.x-.5,o.y-.5,2,2),u.fillStyle="#FFFFFF",t=0;t<f.length;t++)e=f[t],o!==e&&null!==e.x&&null!==e.y&&(i=o.x-e.x,r=o.y-e.y,l=i*i+r*r,l<e.max&&(e===h&&l>=e.max/2&&(o.x-=.03*i,o.y-=.03*r),n=(e.max-l)/e.max,u.beginPath(),u.lineWidth=n/2,u.strokeStyle="rgba("+c.c+","+(n+.2)+")",u.moveTo(o.x,o.y),u.lineTo(e.x,e.y),u.stroke()));f.splice(f.indexOf(o),1)})),m(o)}}var s,a,r=document.createElement("canvas"),c=n(),l="c_n"+c.l,u=r.getContext("2d"),d=0,m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/45)},f=Math.random,h={x:null,y:null,max:2e4};r.id=l,r.style.cssText="position:fixed;top:0;left:0;z-index:"+c.z+";opacity:"+c.o,t("body")[0].appendChild(r),i(),window.onresize=i,window.onmousemove=function(e){e=e||window.event,h.x=e.clientX,h.y=e.clientY},window.onmouseout=function(){h.x=null,h.y=null};for(var p=[],g=0;c.n>g;g++){var v=f()*s,w=f()*a,x=2*f()-1,y=2*f()-1;p.push({x:v,y:w,xa:x,ya:y,max:6e3})}setTimeout((function(){o()}),100)}();var l=n("d225"),u=n("b0b4"),d=(n("9973"),310),m=155,f=42,h=9,p=Math.PI,g=f+2*h+3;function v(e,t){return Math.round(Math.random()*(t-e)+e)}function w(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n}function x(e){var t=new Image;return t.crossOrigin="Anonymous",t.onload=e,t.onerror=function(){t.setSrc(I())},t.setSrc=function(e){var n=window.navigator.userAgent.indexOf("Trident")>-1;if(n){var i=new XMLHttpRequest;i.onloadend=function(e){var n=new FileReader;n.readAsDataURL(e.target.response),n.onloadend=function(e){t.src=e.target.result}},i.open("GET",e),i.responseType="blob",i.send()}else t.src=e},t.setSrc(I()),t}function y(e,t){var n=document.createElement(e);return n.className=t,n}function b(e,t){e.classList.add(t)}function k(e,t){e.classList.remove(t)}function I(){return"https://picsum.photos/".concat(d,"/").concat(m,"/?image=").concat(v(0,1084))}function C(e,t,n,i){e.beginPath(),e.moveTo(t,n),e.arc(t+f/2,n-h+2,h,.72*p,2.26*p),e.lineTo(t+f,n),e.arc(t+f+h-2,n+f/2,h,1.21*p,2.78*p),e.lineTo(t+f,n+f),e.lineTo(t,n+f),e.arc(t+h-2,n+f/2,h+.4,2.76*p,1.24*p,!0),e.lineTo(t,n),e.lineWidth=2,e.fillStyle="rgba(255, 255, 255, 0.7)",e.strokeStyle="rgba(255, 255, 255, 0.7)",e.stroke(),e[i](),e.globalCompositeOperation="destination-over"}function _(e,t){return e+t}function E(e){return e*e}var T=function(){function e(t){var n=t.el,i=t.width,o=void 0===i?310:i,s=t.height,a=void 0===s?155:s,r=t.onSuccess,c=t.onFail,u=t.onRefresh;Object(l["a"])(this,e),d=o,m=a,console.log(n),n.style.position="relative",n.style.width=d+"px",Object.assign(n.style,{position:"relative",width:d+"px",margin:"0 auto"}),this.el=n,this.onSuccess=r,this.onFail=c,this.onRefresh=u}return Object(u["a"])(e,[{key:"init",value:function(){this.initDOM(),this.initImg(),this.bindEvents()}},{key:"initDOM",value:function(){var e=w(d,m),t=e.cloneNode(!0),n=y("div","sliderContainer");n.style.width=d+"px";var i=y("div","refreshIcon"),o=y("div","sliderMask"),s=y("div","slider"),a=y("span","sliderIcon"),r=y("span","sliderText");t.className="block",r.innerHTML="向右滑动填充拼图";var c=this.el;c.appendChild(e),c.appendChild(i),c.appendChild(t),s.appendChild(a),o.appendChild(s),n.appendChild(o),n.appendChild(r),c.appendChild(n),Object.assign(this,{canvas:e,block:t,sliderContainer:n,refreshIcon:i,slider:s,sliderMask:o,sliderIcon:a,text:r,canvasCtx:e.getContext("2d"),blockCtx:t.getContext("2d")})}},{key:"initImg",value:function(){var e=this,t=x((function(){e.draw(),e.canvasCtx.drawImage(t,0,0,d,m),e.blockCtx.drawImage(t,0,0,d,m);var n=e.y-2*h-1,i=e.blockCtx.getImageData(e.x-3,n,g,g);e.block.width=g,e.blockCtx.putImageData(i,0,n)}));this.img=t}},{key:"draw",value:function(){this.x=v(g+10,d-(g+10)),this.y=v(10+2*h,m-(g+10)),C(this.canvasCtx,this.x,this.y,"fill"),C(this.blockCtx,this.x,this.y,"clip")}},{key:"clean",value:function(){this.canvasCtx.clearRect(0,0,d,m),this.blockCtx.clearRect(0,0,d,m),this.block.width=d}},{key:"bindEvents",value:function(){var e=this;this.el.onselectstart=function(){return!1},this.refreshIcon.onclick=function(){e.reset(),"function"===typeof e.onRefresh&&e.onRefresh()};var t,n,i=[],o=!1,s=function(e){t=e.clientX||e.touches[0].clientX,n=e.clientY||e.touches[0].clientY,o=!0},a=function(s){if(!o)return!1;var a=s.clientX||s.touches[0].clientX,r=s.clientY||s.touches[0].clientY,c=a-t,l=r-n;if(c<0||c+38>=d)return!1;e.slider.style.left=c+"px";var u=(d-40-20)/(d-40)*c;e.block.style.left=u+"px",b(e.sliderContainer,"sliderContainer_active"),e.sliderMask.style.width=c+"px",i.push(l)},r=function(n){if(!o)return!1;o=!1;var s=n.clientX||n.changedTouches[0].clientX;if(s===t)return!1;k(e.sliderContainer,"sliderContainer_active"),e.trail=i;var a=e.verify(),r=a.spliced,c=a.verified;r?c?(b(e.sliderContainer,"sliderContainer_success"),"function"===typeof e.onSuccess&&e.onSuccess()):(b(e.sliderContainer,"sliderContainer_fail"),e.text.innerHTML="请再试一次",e.reset()):(b(e.sliderContainer,"sliderContainer_fail"),"function"===typeof e.onFail&&e.onFail(),setTimeout((function(){e.reset()}),1e3))};this.slider.addEventListener("mousedown",s),this.slider.addEventListener("touchstart",s),this.block.addEventListener("mousedown",s),this.block.addEventListener("touchstart",s),document.addEventListener("mousemove",a),document.addEventListener("touchmove",a),document.addEventListener("mouseup",r),document.addEventListener("touchend",r)}},{key:"verify",value:function(){var e=this.trail,t=e.reduce(_)/e.length,n=e.map((function(e){return e-t})),i=Math.sqrt(n.map(E).reduce(_)/e.length),o=parseInt(this.block.style.left);return{spliced:Math.abs(o-this.x)<10,verified:0!==i}}},{key:"reset",value:function(){this.sliderContainer.className="sliderContainer",this.slider.style.left=0,this.block.style.left=0,this.sliderMask.style.width=0,this.clean(),this.img.setSrc(I())}}]),e}();window.jigsaw={init:function(e){var t=new T(e);return t.init(),t}};var L={data:function(){return{fullWidth:document.documentElement.clientWidth,swiperOption:{pagination:".swiper-pagination",autoplay:!0},loading:!1,modals:!1,autoLogin:!0,imgcode:"",formInline:{username:"",password:"",code:""},ruleInline:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}]},errorNum:0,jigsaw:null,login_logo:"",swiperList:[],defaultSwiperList:n("433f")}},created:function(){var e=this;top!=window&&(top.location.href=location.href),document.onkeydown=function(t){if("login"===e.$route.name){var n=window.event.keyCode;13===n&&e.handleSubmit("formInline")}},window.addEventListener("resize",this.handleResize)},watch:{fullWidth:function(e){if(!this.timer){this.screenWidth=e,this.timer=!0;var t=this;setTimeout((function(){t.timer=!1}),400)}},$route:function(e){this.captchas()}},mounted:function(){var e=this;this.$nextTick((function(){var t=e;e.jigsaw=jigsaw.init({el:e.$refs.captcha,onSuccess:function(){t.modals=!1,t.closeModel()},onFail:e.closefail,onRefresh:function(){}}),e.screenWidth<768?document.getElementsByTagName("canvas")[0].removeAttribute("class","index_bg"):document.getElementsByTagName("canvas")[0].className="index_bg",e.swiperData()})),this.captchas()},methods:{swiperData:function(){var e=this;Object(a["c"])().then((function(t){localStorage.setItem("ADMIN_TITLE",t.data.site_name);var i=t.data||{};e.login_logo=i.login_logo?i.login_logo:n("9d64"),e.swiperList=i.slide.length?i.slide:[{slide:e.defaultSwiperList}]})).catch((function(t){e.$Message.error(t),e.login_logo=n("9d64"),e.swiperList=[{slide:e.defaultSwiperList}]}))},closeModel:function(){var e=this,t=this.$Message.loading({content:"登录中...",duration:0});this.loading=!0,Object(a["a"])({account:this.formInline.username,pwd:this.formInline.password,imgcode:this.formInline.code}).then(function(){var n=Object(s["a"])(regeneratorRuntime.mark((function n(i){var o,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t(),o=i.data,s=e.getExpiresTime(o.expires_time),Object(c["q"])("uuid",o.user_info.id,s),Object(c["q"])("token",o.token,s),Object(c["q"])("expires_time",o.expires_time,s),e.$store.commit("userInfo/uniqueAuth",o.unique_auth),e.$store.commit("userInfo/userInfo",o.user_info),e.$store.commit("menus/setopenMenus",[]),e.$store.commit("menus/getmenusNav",o.menus),e.$store.commit("userInfo/name",o.user_info.account),e.$store.commit("userInfo/avatar",o.user_info.head_pic),e.$store.commit("userInfo/access",o.unique_auth),e.$store.commit("userInfo/logo",o.logo),e.$store.commit("userInfo/logoSmall",o.logo_square),e.$store.commit("userInfo/version",o.version),e.$store.commit("userInfo/newOrderAudioLink",o.newOrderAudioLink),e.jigsaw&&e.jigsaw.reset(),n.abrupt("return",e.$router.replace({path:"/admin/home/"}));case 19:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(n){t(),e.formInline.code="";var i=void 0===n?{}:n;e.errorNum++,e.captchas(),e.$Message.error(i.msg||"登录失败"),e.jigsaw&&e.jigsaw.reset()})),setTimeout((function(t){e.loading=!1}),1e3)},getExpiresTime:function(e){var t=Math.round(new Date/1e3),n=e-t;return parseFloat(parseFloat(parseFloat(n/60)/60)/24)},closefail:function(){this.jigsaw&&this.jigsaw.reset(),this.$Message.error("校验错误")},handleResize:function(e){this.fullWidth=document.documentElement.clientWidth,this.fullWidth<768?document.getElementsByTagName("canvas")[0].removeAttribute("class","index_bg"):document.getElementsByTagName("canvas")[0].className="index_bg"},captchas:function(){this.imgcode=r["a"].apiBaseURL+"/captcha_pro?"+Date.parse(new Date)},handleSubmit:function(e){var t=this;this.$refs[e].validate((function(e){e&&(t.errorNum>=2?t.modals=!0:t.closeModel())}))}},beforeCreate:function(){this.fullWidth<768?document.getElementsByTagName("canvas")[0].removeAttribute("class","index_bg"):document.getElementsByTagName("canvas")[0].className="index_bg"},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize),document.getElementsByTagName("canvas")[0].removeAttribute("class","index_bg")}},M=L,F=(n("956b"),n("2877")),S=Object(F["a"])(M,i,o,!1,null,"17c356d2",null);t["default"]=S.exports},"433f":function(e,t,n){e.exports=n.p+"img/sw.3ef10e8b.jpg"},"956b":function(e,t,n){"use strict";var i=n("d56c"),o=n.n(i);o.a},9973:function(e,t,n){},d56c:function(e,t,n){}}]); |