kefu/knowledge/pannel/static/js/chunk-57d5318b.9c494a61.js

1 line
3.5 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-57d5318b"],{"6ab7":function(e,t,s){},"7e75":function(e,t,s){"use strict";s("6ab7")},"8b9b":function(e,t,s){"use strict";s("fd3a")},"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("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,"auto-complete":"on","label-position":"left"}},[s("div",{staticClass:"title-container"},[s("h3",{staticClass:"title"},[e._v("知识库AI")])]),s("el-form-item",{attrs:{prop:"collectName"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"user"}})],1),s("el-input",{ref:"collectName",attrs:{placeholder:"知识库集合名称",name:"collectName",type:"text",tabindex:"1","auto-complete":"on"},model:{value:e.loginForm.collectName,callback:function(t){e.$set(e.loginForm,"collectName",t)},expression:"loginForm.collectName"}})],1),s("el-form-item",{staticStyle:{display:"none"},attrs:{prop:"username"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"user"}})],1),s("el-input",{ref:"username",attrs:{placeholder:"Username",name:"username",type:"text",tabindex:"1","auto-complete":"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),s("el-form-item",{staticStyle:{display:"none"},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:"Password",name:"password",tabindex:"2","auto-complete":"on"},nativeOn:{keyup: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),s("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("Login")]),s("div",{staticClass:"tips"},[s("span",[e._v("请联系管理员,创建知识库集合")])])],1)],1)},a=[],r=s("61f7"),n={name:"Login",data(){const e=(e,t,s)=>{Object(r["b"])(t)?s():s(new Error("Please enter the correct user name"))},t=(e,t,s)=>{""==t?s(new Error("请输入正确的集合名称")):s()},s=(e,t,s)=>{t.length<6?s(new Error("The password can not be less than 6 digits")):s()};return{loginForm:{username:"admin",password:"111111",collectName:""},loginRules:{username:[{required:!0,trigger:"blur",validator:e}],password:[{required:!0,trigger:"blur",validator:s}],collectName:[{required:!0,trigger:"blur",validator:t}]},loading:!1,passwordType:"password",redirect:void 0}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{showPwd(){"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick(()=>{this.$refs.password.focus()})},handleLogin(){this.$refs.loginForm.validate(e=>{if(!e)return!1;this.loading=!0,this.$store.dispatch("user/login",this.loginForm).then(()=>{this.$router.push({path:this.redirect||"/"})}),this.loading=!1})}}},i=n,l=(s("8b9b"),s("7e75"),s("2877")),c=Object(l["a"])(i,o,a,!1,null,"5e1b5f40",null);t["default"]=c.exports},fd3a:function(e,t,s){}}]);