chunk-712c0160.de531471.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-712c0160"],{"0740":function(e,t,o){},"54de":function(e,t,o){"use strict";o("5fab")},"5fab":function(e,t,o){},"9ed6":function(e,t,o){"use strict";o.r(t);var n=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("div",{staticClass:"gradient-background"}),o("canvas",{attrs:{id:"canvas1"}}),o("div",{staticClass:"form-content"},["login"==e.loginOrRetrieve?o("div",{staticClass:"login_form"},[o("h2",[e._v("AI知识库管理")]),o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[o("el-form-item",{attrs:{prop:"username"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"user"}})],1),o("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),o("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),o("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"}}),o("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),o("div",{staticClass:"tips"},[o("div",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.Retrieve("retrieve")}}},[e._v(" 找回密码? ")])]),o("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?o("div",{staticClass:"login_form"},[o("h2",[e._v("AI知识库管理")]),o("el-form",{ref:"RetrieveForm",staticClass:"login-form",attrs:{model:e.RetrieveForm,rules:e.RetrieveRules,autocomplete:"on","label-position":"left"}},[o("el-form-item",{attrs:{prop:"phone"}},[o("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),o("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"verification_code"}},[o("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"}}),o("span",{staticClass:"show-pwd"},[o("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:e.getCode}},[e._v(" "+e._s(e.buttonText)+" ")])],1)],1)],1),o("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"new_password1"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),o("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"}}),o("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),o("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[o("el-form-item",{attrs:{prop:"new_password2"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),o("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"}}),o("span",{staticClass:"show-pwd",on:{click:e.showPwds}},[o("svg-icon",{attrs:{"icon-class":"password"===e.passwordTypes?"eye":"eye-open"}})],1)],1)],1),o("div",{staticClass:"tips"},[o("div",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.Retrieve("login")}}},[e._v(" 返回登录 ")])]),o("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()])])},i=[],s=o("d4ec"),r=o("bee2"),a=(o("cb29"),o("13d5"),o("b64b"),o("d3b7"),o("ac1f"),o("00b4"),o("61f7"),o("b775"));function c(e){return Object(a["a"])({url:"/SMS/tailPhone",method:"post",data:e})}function l(e){return Object(a["a"])({url:"SMS/codeCheckout",method:"post",data:e})}function p(e){return Object(a["a"])({url:"SMS/updatePassword",method:"post",data:e})}var d=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"social-signup-container"},[o("div",{staticClass:"sign-btn",on:{click:function(t){return e.wechatHandleClick("wechat")}}},[o("span",{staticClass:"wx-svg-container"},[o("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),e._v(" WeChat ")]),o("div",{staticClass:"sign-btn",on:{click:function(t){return e.tencentHandleClick("tencent")}}},[o("span",{staticClass:"qq-svg-container"},[o("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=(o("aa05"),o("2877")),w=Object(v["a"])(f,d,u,!1,null,"7309fbbb",null),m=w.exports,g={name:"Login",components:{SocialSign:m},data:function(){var e=this,t=function(e,t,o){t.length<3?o(new Error("请填写正确的登录用户名")):o()},o=function(e,t,o){t.length<6?o(new Error("请填写正确的密码,密码不得小于6位")):o()},n=function(e,t,o){var n=/^1[3-9]\d{9}$/;""===t?o(new Error("请输入手机号码")):n.test(t)?o():o(new Error("请输入正确的手机号码"))},i=function(t,o,n){o.length<6?n(new Error("新密码不能少于6个字符")):(""!==e.RetrieveForm.new_password2&&e.$refs.RetrieveForm.validateField("new_password2"),n())},s=function(t,o,n){""===o?n(new Error("请再次输入密码")):o!==e.RetrieveForm.new_password1?n(new Error("两次输入的密码不一致")):n()};return{loginForm:{username:"",password:""},loginRules:{username:[{required:!0,trigger:"blur",validator:t}],password:[{required:!0,trigger:"blur",validator:o}]},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:n}],verification_code:[{required:!0,message:"请输入验证码",trigger:"blur"}],new_password1:[{required:!0,trigger:"blur",validator:i}],new_password2:[{required:!0,trigger:"blur",validator:s}]},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&&p(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 o=setInterval((function(){e.countdown>0?(e.countdown--,e.buttonText="".concat(e.countdown,"s")):(clearInterval(o),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,o){return"redirect"!==o&&(t[o]=e[o]),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;Math.sqrt(e.width*e.height);var o,n=e.width*e.height/8e3,i={x:null,y:null,radius:n};window.addEventListener("mousemove",(function(e){i.x=e.x,i.y=e.y})),window.addEventListener("mouseout",(function(e){i.x=void 0,i.y=void 0})),window.addEventListener("resize",(function(t){e.width=innerWidth,e.height=innerHeight,n=e.width*e.height/9e3,c()}));var a=function(){function o(e,t,n,i,r,a){Object(s["a"])(this,o),this.x=e,this.y=t,this.velX=n,this.velY=i,this.size=r,this.color=a}return Object(r["a"])(o,[{key:"draw",value:function(){t.beginPath(),t.arc(this.x,this.y,this.size,0,2*Math.PI,!1),t.fillStyle="#ffffff",t.fill()}},{key:"update",value:function(){(this.x>e.width||this.x<0)&&(this.velX=-this.velX),(this.y>e.height||this.y<0)&&(this.velY=-this.velY);var t=i.x-this.x,o=i.y-this.y,n=Math.sqrt(t*t+o*o);if(n<i.radius+this.size){var s=10*this.size;i.x<this.x&&this.x<e.width-s&&(this.x+=10),i.x>this.x&&this.x>s&&(this.x-=10),i.y<this.y&&this.y<e.height-s&&(this.y+=10),i.y>this.y&&this.y>s&&(this.y-=10)}this.x+=this.velX,this.y+=this.velY,this.draw()}}])}();function c(){o=[];for(var t=e.width*e.height/1e4,n=0;n<t;n++){var i=5*Math.random()+1,s=Math.random()*(innerWidth-2*i)+2*i,r=Math.random()*(innerHeight-2*i)+2*i,c=2*Math.random(),l=2*Math.random(),p="#ffffff";o.push(new a(s,r,c,l,i,p))}}function l(){for(var n=e.width*e.height/81,i=0;i<o.length;i++)for(var s=i;s<o.length;s++){var r=Math.pow(o[i].x-o[s].x,2)+Math.pow(o[i].y-o[s].y,2),a=1-r/25e3;r<n&&(t.strokeStyle="rgba(255,255,255,"+a+")",t.lineWidth=1,t.beginPath(),t.moveTo(o[i].x,o[i].y),t.lineTo(o[s].x,o[s].y),t.stroke())}}function p(){requestAnimationFrame(p),t.clearRect(0,0,innerWidth,innerHeight);for(var e=0;e<o.length;e++)o[e].update();l()}c(),p()}}},y=g,b=(o("54de"),Object(v["a"])(y,n,i,!1,null,null,null));t["default"]=b.exports},aa05:function(e,t,o){"use strict";o("0740")},bee2:function(e,t,o){"use strict";o.d(t,"a",(function(){return s}));var n=o("a38e");function i(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Object(n["a"])(i.key),i)}}function s(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}},d4ec:function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}o.d(t,"a",(function(){return n}))}}]);