chunk-548f9440.7c018f8b.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-548f9440"],{"0740":function(e,t,s){},"428c":function(e,t,s){},"9e10":function(e,t,s){"use strict";s("428c")},"9ed6":function(e,t,s){"use strict";s.r(t);var o=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"login-container"},[s("div",{staticClass:"gradient-background"}),s("canvas",{attrs:{id:"canvas1"}}),s("div",{staticClass:"form-content"},["login"==e.loginOrRetrieve?s("div",{staticClass:"login_form"},[s("h2",[e._v("AI知识库管理")]),s("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[s("el-form-item",{attrs:{prop:"username"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"user"}})],1),s("el-input",{ref:"username",attrs:{placeholder:"登录用户名",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),s("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[s("el-form-item",{attrs:{prop:"password"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"password"}})],1),s("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"登录密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(t){e.capsTooltip=!1}},nativeOn:{keyup:[function(t){return e.checkCapslock(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}]},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),s("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[s("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),s("div",{staticClass:"tips"},[s("div",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.Retrieve("retrieve")}}},[e._v(" 找回密码? ")])]),s("el-button",{staticClass:"login_btns",staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},on:{click:e.handleLogin}},[e._v("立即登录")])],1)],1):e._e(),"retrieve"==e.loginOrRetrieve?s("div",{staticClass:"login_form"},[s("h2",[e._v("AI知识库管理")]),s("el-form",{ref:"RetrieveForm",staticClass:"login-form",attrs:{model:e.RetrieveForm,rules:e.RetrieveRules,autocomplete:"on","label-position":"left"}},[s("el-form-item",{attrs:{prop:"phone"}},[s("el-input",{ref:"phone",attrs:{placeholder:"请输入手机号",name:"phone",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.RetrieveForm.phone,callback:function(t){e.$set(e.RetrieveForm,"phone",t)},expression:"RetrieveForm.phone"}})],1),s("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[s("el-form-item",{attrs:{prop:"verification_code"}},[s("el-input",{ref:"verification_code",attrs:{type:"text",placeholder:"请输入验证码",name:"text",tabindex:"2",autocomplete:"on"},model:{value:e.RetrieveForm.verification_code,callback:function(t){e.$set(e.RetrieveForm,"verification_code",t)},expression:"RetrieveForm.verification_code"}}),s("span",{staticClass:"show-pwd"},[s("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:e.getCode}},[e._v(" "+e._s(e.buttonText)+" ")])],1)],1)],1),s("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[s("el-form-item",{attrs:{prop:"new_password1"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"password"}})],1),s("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"请输入新密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(t){e.capsTooltip=!1}},nativeOn:{keyup:function(t){return e.checkCapslock(t)}},model:{value:e.RetrieveForm.new_password1,callback:function(t){e.$set(e.RetrieveForm,"new_password1",t)},expression:"RetrieveForm.new_password1"}}),s("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[s("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),s("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[s("el-form-item",{attrs:{prop:"new_password2"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"password"}})],1),s("el-input",{key:e.passwordType,ref:"passwords",attrs:{type:e.passwordTypes,placeholder:"确认新密码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(t){e.capsTooltips=!1}},nativeOn:{keyup:function(t){return e.checkCapslock(t)}},model:{value:e.RetrieveForm.new_password2,callback:function(t){e.$set(e.RetrieveForm,"new_password2",t)},expression:"RetrieveForm.new_password2"}}),s("span",{staticClass:"show-pwd",on:{click:e.showPwds}},[s("svg-icon",{attrs:{"icon-class":"password"===e.passwordTypes?"eye":"eye-open"}})],1)],1)],1),s("div",{staticClass:"tips"},[s("div",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.Retrieve("login")}}},[e._v(" 返回登录 ")])]),s("el-button",{staticClass:"login_btns",staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},on:{click:e.retPass}},[e._v("重置密码")])],1)],1):e._e()])])},n=[],i=s("d4ec"),a=s("bee2"),r=(s("cb29"),s("13d5"),s("b64b"),s("d3b7"),s("ac1f"),s("00b4"),s("61f7"),s("b775"));function c(e){return Object(r["a"])({url:"/SMS/tailPhone",method:"post",data:e})}function l(e){return Object(r["a"])({url:"SMS/codeCheckout",method:"post",data:e})}function d(e){return Object(r["a"])({url:"SMS/updatePassword",method:"post",data:e})}var p=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"social-signup-container"},[s("div",{staticClass:"sign-btn",on:{click:function(t){return e.wechatHandleClick("wechat")}}},[s("span",{staticClass:"wx-svg-container"},[s("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),e._v(" WeChat ")]),s("div",{staticClass:"sign-btn",on:{click:function(t){return e.tencentHandleClick("tencent")}}},[s("span",{staticClass:"qq-svg-container"},[s("svg-icon",{staticClass:"icon",attrs:{"icon-class":"qq"}})],1),e._v(" QQ ")])])},u=[],h={name:"SocialSignin",methods:{wechatHandleClick:function(e){alert("ok")},tencentHandleClick:function(e){alert("ok")}}},f=h,v=(s("aa05"),s("2877")),m=Object(v["a"])(f,p,u,!1,null,"7309fbbb",null),w=m.exports,g={name:"Login",components:{SocialSign:w},data:function(){var e=this,t=function(e,t,s){t.length<3?s(new Error("请填写正确的登录用户名")):s()},s=function(e,t,s){t.length<6?s(new Error("请填写正确的密码,密码不得小于6位")):s()},o=function(e,t,s){var o=/^1[3-9]\d{9}$/;""===t?s(new Error("请输入手机号码")):o.test(t)?s():s(new Error("请输入正确的手机号码"))},n=function(t,s,o){s.length<6?o(new Error("新密码不能少于6个字符")):(""!==e.RetrieveForm.new_password2&&e.$refs.RetrieveForm.validateField("new_password2"),o())},i=function(t,s,o){""===s?o(new Error("请再次输入密码")):s!==e.RetrieveForm.new_password1?o(new Error("两次输入的密码不一致")):o()};return{loginForm:{username:"",password:""},loginRules:{username:[{required:!0,trigger:"blur",validator:t}],password:[{required:!0,trigger:"blur",validator:s}]},passwordType:"password",passwordTypes:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{},loginOrRetrieve:"login",RetrieveForm:{phone:"",verification_code:"",new_password1:"",new_password2:""},RetrieveRules:{phone:[{required:!0,trigger:"blur",validator:o}],verification_code:[{required:!0,message:"请输入验证码",trigger:"blur"}],new_password1:[{required:!0,trigger:"blur",validator:n}],new_password2:[{required:!0,trigger:"blur",validator:i}]},countdown:60,isDisabled:!1,buttonText:"获取验证码"}},watch:{$route:{handler:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus(),this.initParticles()},destroyed:function(){},methods:{retPass:function(){var e=this;this.$refs.RetrieveForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;l({phone:e.RetrieveForm.phone,verification_code:e.RetrieveForm.verification_code}).then((function(t){200===t.status&&d(e.RetrieveForm).then((function(t){e.loginOrRetrieve="login",e.$message.success("密码已成功重置")}))})).catch((function(t){e.$message.error("验证码校验失败")}))}))},getCode:function(){var e=this;this.$refs.RetrieveForm.validateField("phone",(function(t){if(t)e.$message.warning(t);else{e.isDisabled=!0,e.buttonText="".concat(e.countdown,"s");var s=setInterval((function(){e.countdown>0?(e.countdown--,e.buttonText="".concat(e.countdown,"s")):(clearInterval(s),e.isDisabled=!1,e.buttonText="获取验证码",e.countdown=60)}),1e3);c({phone:e.RetrieveForm.phone}).then((function(e){console.log(e)}))}}))},showPwds:function(){var e=this;"password"===this.passwordTypes?this.passwordTypes="":this.passwordTypes="password",this.$nextTick((function(){e.$refs.passwords.focus()}))},checkCapslock:function(e){var t=e.key;this.capsTooltip=t&&1===t.length&&t>="A"&&t<="Z"},showPwd:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.password.focus()}))},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(){e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loading=!1})).catch((function(){e.loading=!1}))}))},getOtherQuery:function(e){return Object.keys(e).reduce((function(t,s){return"redirect"!==s&&(t[s]=e[s]),t}),{})},Retrieve:function(e){this.loginOrRetrieve=e},initParticles:function(){var e=document.getElementById("canvas1"),t=e.getContext("2d");e.width=window.innerWidth,e.height=window.innerHeight;var s={x:null,y:null,radius:150};e.addEventListener("mousemove",(function(e){s.x=e.x,s.y=e.y})),e.addEventListener("mouseout",(function(){s.x=void 0,s.y=void 0}));var o=function(){function o(){Object(i["a"])(this,o),this.x=Math.random()*e.width,this.y=Math.random()*e.height,this.size=3*Math.random()+1,this.baseX=this.x,this.baseY=this.y,this.density=30*Math.random()+1,this.speedX=3.5*(Math.random()-.5),this.speedY=3.5*(Math.random()-.5),this.angle=360*Math.random(),this.angleSpeed=2*(Math.random()-.5),this.oscillationRadius=5*Math.random()}return Object(a["a"])(o,[{key:"draw",value:function(){t.beginPath(),t.arc(this.x,this.y,this.size,0,2*Math.PI),t.fillStyle="#ffffff",t.fill()}},{key:"update",value:function(){this.angle>360&&(this.angle-=360);var t=this.angle*Math.PI/180,o=Math.sin(t)*this.oscillationRadius*.1;this.baseX+=this.speedX+o,this.baseY+=this.speedY+o,(this.baseX>e.width||this.baseX<0)&&(this.speedX*=-1),(this.baseY>e.height||this.baseY<0)&&(this.speedY*=-1);var n=5;this.speedX=Math.max(Math.min(this.speedX,n),-n),this.speedY=Math.max(Math.min(this.speedY,n),-n);var i=s.x-this.x,a=s.y-this.y,r=Math.sqrt(i*i+a*a),c=i/r,l=a/r,d=s.radius,p=(d-r)/d,u=c*p*this.density,h=l*p*this.density;if(r<s.radius&&void 0!=s.x)this.x-=2*u,this.y-=2*h;else{if(this.x!==this.baseX){var f=this.x-this.baseX;this.x-=f/5}if(this.y!==this.baseY){var v=this.y-this.baseY;this.y-=v/5}}}}])}(),n=[];function r(){n=[];for(var t=e.width*e.height/7e3,s=0;s<t;s++)n.push(new o)}function c(){for(var s=1,o=0;o<n.length;o++)for(var i=o;i<n.length;i++){var a=(n[o].x-n[i].x)*(n[o].x-n[i].x)+(n[o].y-n[i].y)*(n[o].y-n[i].y);a<e.width/6*(e.height/6)&&(s=1-a/15e3,t.strokeStyle="rgba(255,255,255,".concat(s,")"),t.lineWidth=1,t.beginPath(),t.moveTo(n[o].x,n[o].y),t.lineTo(n[i].x,n[i].y),t.stroke())}}function l(){t.clearRect(0,0,e.width,e.height);for(var s=0;s<n.length;s++)n[s].update(),n[s].draw();c(),requestAnimationFrame(l)}window.addEventListener("resize",(function(){e.width=window.innerWidth,e.height=window.innerHeight,r()})),r(),l()}}},b=g,y=(s("9e10"),Object(v["a"])(b,o,n,!1,null,null,null));t["default"]=y.exports},aa05:function(e,t,s){"use strict";s("0740")},bee2:function(e,t,s){"use strict";s.d(t,"a",(function(){return i}));var o=s("a38e");function n(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Object(o["a"])(n.key),n)}}function i(e,t,s){return t&&n(e.prototype,t),s&&n(e,s),Object.defineProperty(e,"prototype",{writable:!1}),e}},d4ec:function(e,t,s){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}s.d(t,"a",(function(){return o}))}}]);