(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-98470a88"],{7780:function(s,r,e){"use strict";e.r(r);var o=function(){var s=this,r=s.$createElement,e=s._self._c||r;return e("el-form",{ref:"form",attrs:{model:s.userPassword,rules:s.rules,"label-width":"80px"}},[e("el-form-item",{attrs:{label:"旧密码",prop:"oldPassword"}},[e("el-input",{attrs:{placeholder:"请输入旧密码",type:"password","show-password":""},model:{value:s.userPassword.oldPassword,callback:function(r){s.$set(s.userPassword,"oldPassword",r)},expression:"userPassword.oldPassword"}})],1),e("el-form-item",{attrs:{label:"新密码",prop:"password"}},[e("el-input",{attrs:{placeholder:"请输入新密码",type:"password","show-password":""},model:{value:s.userPassword.password,callback:function(r){s.$set(s.userPassword,"password",r)},expression:"userPassword.password"}})],1),e("el-form-item",{attrs:{label:"确认密码",prop:"confirmPassword"}},[e("el-input",{attrs:{placeholder:"请确认新密码",type:"password","show-password":""},model:{value:s.userPassword.confirmPassword,callback:function(r){s.$set(s.userPassword,"confirmPassword",r)},expression:"userPassword.confirmPassword"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:s.submit}},[s._v("保存")]),e("el-button",{attrs:{type:"danger",size:"mini"},on:{click:s.close}},[s._v("关闭")])],1)],1)},a=[],t=(e("d9e2"),e("14d9"),e("f474")),d=(e("f9ac"),e("4360")),u={props:{user:{type:Object}},data:function(){var s=this,r=function(r,e,o){s.userPassword.password!==e?o(new Error("两次输入的密码不一致")):o()};return{userPassword:{oldPassword:void 0,password:void 0,confirmPassword:void 0,id:null},rules:{oldPassword:[{required:!0,message:"旧密码不能为空",trigger:"blur"}],password:[{required:!0,message:"新密码不能为空",trigger:"blur"},{min:6,max:20,message:"长度在 6 到 20 个字符",trigger:"blur"}],confirmPassword:[{required:!0,message:"确认密码不能为空",trigger:"blur"},{required:!0,validator:r,trigger:"blur"}]}}},methods:{submit:function(){var s=this;this.$refs["form"].validate((function(r){r&&(s.userPassword.id=s.user.id,Object(t["a"])(s.userPassword).then((function(r){200==r.code?(s.$message({message:"修改成功",type:"success"}),d["a"].dispatch("user/resetToken").then((function(){location.reload()}))):s.$message.error(r.msg)})))}))},close:function(){this.$router.push("/dashboard")}}},n=u,i=e("2877"),l=Object(i["a"])(n,o,a,!1,null,null,null);r["default"]=l.exports},f474:function(s,r,e){"use strict";e.d(r,"b",(function(){return a})),e.d(r,"a",(function(){return t}));var o=e("b775");function a(s){return Object(o["a"])({url:"/getInfo",method:"get",data:s})}function t(s){return Object(o["a"])({url:"/system/user/updateUser",method:"post",data:s})}}}]);