You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
5.6 KiB
1 lines
5.6 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user"],{6907:function(e,r,t){"use strict";t("f1ae")},"9dce":function(e,r,t){"use strict";t.r(r);var a=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("content-header",{attrs:{title:"管理员设置"}}),r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"管理员用户名",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"后台登录用户名"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["user_name",{rules:[{required:!0,min:4,message:"请输入至少4个字符"}]}],expression:"['user_name', {rules: [{required: true, min: 4, message: '请输入至少4个字符'}]}]"}]})],1),r("a-form-item",{attrs:{label:"用户密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"后台登录密码"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,min:6,message:"请输入至少6个字符"}]}],expression:"['password', {rules: [\n {required: true, min: 6, message: '请输入至少6个字符'}\n ]}]"}],attrs:{type:"password"}})],1),r("a-form-item",{attrs:{label:"确认密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password_confirm",{rules:[{required:!0,message:"请输入确认密码"},{validator:e.compareToFirstPassword}]}],expression:"['password_confirm', {rules: [\n {required: true, message: '请输入确认密码'},\n {validator: compareToFirstPassword}\n ]}]"}],attrs:{type:"password"}})],1),r("a-form-item",{attrs:{wrapperCol:{span:13,offset:6}}},[r("a-button",{attrs:{type:"primary",loading:e.isLoading,disabled:e.isLoading},on:{click:e.handleSubmit}},[e._v("提交")])],1)],1)],1)},s=[],o=(t("d3b7"),t("e17e")),i=t("2af9"),n={name:"TableList",components:{ContentHeader:i["a"],STable:i["e"]},data:function(){return{labelCol:{span:6},wrapperCol:{span:13},isLoading:!1,form:this.$form.createForm(this)}},created:function(){var e=this;this.$nextTick((function(){e.getInfo()}))},methods:{getInfo:function(){var e=this;this.isLoading=!0,Object(o["a"])().then((function(r){var t=r.data.userInfo;e.form.setFieldsValue({user_name:t["user_name"]})})).finally((function(){return e.isLoading=!1}))},compareToFirstPassword:function(e,r,t){var a=this.form;return!r||r===a.getFieldValue("password")||new Error("您输入的确认密码不一致")},handleSubmit:function(){var e=this,r=this.form.validateFields;r((function(r,t){r||(e.isLoading=!0,e.onFormSubmit(t).finally((function(){return e.isLoading=!1})))}))},onFormSubmit:function(e){var r=this;return Object(o["b"])({form:e}).then((function(e){r.$message.success(e.message),setTimeout((function(){window.location.reload()}),1200)}))}}},l=n,u=t("2877"),c=Object(u["a"])(l,a,s,!1,null,null,null);r["default"]=c.exports},ac2a:function(e,r,t){"use strict";t.r(r);var a=function(){var e=this,r=e._self._c;return r("div",{staticClass:"main"},[e._m(0),r("a-form",{ref:"formLogin",staticClass:"user-layout-login",attrs:{id:"formLogin",form:e.form},on:{submit:e.handleSubmit}},[e.isLoginError?r("a-alert",{staticStyle:{"margin-bottom":"24px"},attrs:{type:"error",showIcon:"",message:e.loginErrorMsg}}):e._e(),r("a-form-item",[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["username",{rules:[{required:!0,message:"您还没有输入用户名"}],validateTrigger:"change"}],expression:"[\n 'username',\n {rules: [{ required: true, message: '您还没有输入用户名' }], validateTrigger: 'change'}\n ]"}],attrs:{size:"large",type:"text",placeholder:"请输入用户名"}},[r("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),r("a-form-item",[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:"您还没有输入用户密码"}],validateTrigger:"blur"}],expression:"[\n 'password',\n {rules: [{ required: true, message: '您还没有输入用户密码' }], validateTrigger: 'blur'}\n ]"}],attrs:{size:"large",type:"password",autocomplete:"false",placeholder:"请输入用户密码"}},[r("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),r("a-form-item",{staticStyle:{"margin-top":"24px"}},[r("a-button",{staticClass:"login-button",attrs:{size:"large",type:"primary",htmlType:"submit",loading:e.state.loginBtn,disabled:e.state.loginBtn}},[e._v("确定")])],1)],1)],1)},s=[function(){var e=this,r=e._self._c;return r("div",{staticClass:"header"},[r("span",{staticClass:"title"},[e._v("管理后台登录")])])}],o=t("5530"),i=(t("d3b7"),t("2f62")),n=t("ca00"),l={data:function(){return{isLoginError:!1,loginErrorMsg:"登录失败",form:this.$form.createForm(this),state:{loginBtn:!1}}},created:function(){},methods:Object(o["a"])(Object(o["a"])({},Object(i["b"])(["Login","Logout"])),{},{handleSubmit:function(e){var r=this;e.preventDefault();var t=this.form.validateFields,a=this.state,s=this.Login;a.loginBtn=!0,t(["username","password"],{force:!0},(function(e,t){e?setTimeout((function(){a.loginBtn=!1}),100):s(t).then((function(e){return r.loginSuccess(e)})).catch((function(e){return r.loginFailed(e)})).finally((function(){a.loginBtn=!1}))}))},loginSuccess:function(e){var r=this;this.$router.push({path:"/"}),setTimeout((function(){r.$notification.success({message:"欢迎",description:"".concat(Object(n["f"])(),",欢迎回来")})}),1e3),this.isLoginError=!1},loginFailed:function(e){this.isLoginError=!0,this.loginErrorMsg=e.message}})},u=l,c=(t("6907"),t("2877")),m=Object(c["a"])(u,a,s,!1,null,"ecb9b698",null);r["default"]=m.exports},f1ae:function(e,r,t){}}]); |