"use strict";(self["webpackChunkwaf_dashboard"]=self["webpackChunkwaf_dashboard"]||[]).push([[110],{47110:function(t,e,r){r.r(e),r.d(e,{default:function(){return n}});var s=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center","margin-top":"70px"}},[t._m(0),e("a-card",{staticClass:"header-solid h-full ant-card",staticStyle:{width:"420px","border-radius":"12px","box-shadow":"0px 20px 27px rgb(0 0 0 / 10%)","background-color":"rgba(255,255,255,0.7)"},attrs:{bordered:!1},scopedSlots:t._u([{key:"title",fn:function(){return[e("img",{staticStyle:{width:"36px"},attrs:{src:"images/logo.png"}}),e("h5",{staticClass:"font-semibold text-center"},[t._v("管理后台")])]},proxy:!0}])},[e("a-form-model",{ref:"userForm",staticStyle:{"text-align":"center"},attrs:{model:t.form,rules:t.rules}},[e("a-form-model-item",{ref:"usr",attrs:{prop:"usr","has-feedback":""}},[e("a-input",{staticStyle:{width:"300px"},attrs:{placeholder:"输入用户名"},model:{value:t.form.usr,callback:function(e){t.$set(t.form,"usr",e)},expression:"form.usr"}},[e("a-icon",{staticStyle:{color:"#52c41a"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),e("a-form-model-item",{attrs:{prop:"pwd","has-feedback":""}},[e("a-input",{staticStyle:{width:"300px"},attrs:{placeholder:"输入密码",type:"password"},model:{value:t.form.pwd,callback:function(e){t.$set(t.form,"pwd",e)},expression:"form.pwd"}},[e("a-icon",{staticStyle:{color:"#52c41a"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),e("a-form-model-item",{attrs:{prop:"otp","has-feedback":""}},[e("a-input",{staticStyle:{width:"300px"},attrs:{placeholder:"输入动态口令"},model:{value:t.form.otp,callback:function(e){t.$set(t.form,"otp",e)},expression:"form.otp"}},[e("a-icon",{staticStyle:{color:"#52c41a"},attrs:{slot:"prefix",type:"safety-certificate"},slot:"prefix"})],1)],1),e("a-form-model-item",[e("a-button",{staticClass:"custom-button",attrs:{size:"small",type:"primary",shape:"round",icon:"login","html-type":"submit"},on:{click:function(e){return t.submitForm("userForm")}}},[t._v(" 登录 ")]),e("a-button",{staticStyle:{"margin-left":"20px"},attrs:{size:"small",shape:"round",icon:"close-circle"},on:{click:function(e){return t.resetForm("userForm")}}},[t._v(" 重置 ")])],1),e("p",{staticClass:"font-semibold text-muted text-center"},[t._v("没有账号? 请联系管理员")])],1)],1)],1)},a=[function(){var t=this,e=t._self._c;return e("div",{staticStyle:{position:"fixed",top:"0",left:"0",bottom:"0",right:"0","z-index":"-1"}},[e("img",{staticStyle:{height:"100%",width:"100%",border:"0"},attrs:{src:"images/bg.png"}})])}],o={data(){return{form:{usr:"",pwd:"",otp:""},rules:{usr:[{required:!0,pattern:/^[\w\d]{2,32}$/,message:"字母或数字2至32位",trigger:"change"}],pwd:[{required:!0,message:"内容为空",trigger:"change"},{min:8,message:"最小长度8位",trigger:"change"}],otp:[{pattern:/^\d{6}$/,message:"6位数字",trigger:"change"}]}}},methods:{submitForm(t){this.$refs[t].validate((t=>{t?this.http({url:"/users/login",method:"post",data:this.form}).then((t=>{t.data.err?this.$message.error("错误："+t.data.err,5):(window.localStorage.setItem("token",t.data.token),this.$message.success("登录成功!"),this.$router.push({name:"态势"}))})).catch((t=>{console.log(t)})):this.$message.error("请修改红色提示输入框内容后重新提交")}))},resetForm(t){this.$refs[t].resetFields()}}},i=o,l=r(81656),c=(0,l.A)(i,s,a,!1,null,null,null),n=c.exports}}]);