VYnJ.3d1bd9da.js 2.8 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["VYnJ"],{VYnJ:function(a,t,e){"use strict";e.r(t);var r=e("QbLZ"),s=e.n(r),o=e("t3Un");var n={name:"ChangePassword",data:function(){var a=this;return{dataForm:{oldPassword:"",newPassword:"",newPassword2:""},rules:{oldPassword:[{required:!0,message:"旧密码不能为空",trigger:"blur"}],newPassword:[{required:!0,message:"新密码不能为空",trigger:"blur"},{min:6,message:"新密码必须大于6",trigger:"blur"},{validator:function(a,t,e){""===t?e(new Error("请输入密码")):e()},trigger:"blur"}],newPassword2:[{required:!0,message:"确认密码不能为空",trigger:"blur"},{min:6,message:"新密码必须大于6",trigger:"blur"},{validator:function(t,e,r){""===e?r(new Error("请再次输入密码")):e!==a.dataForm.newPassword?r(new Error("两次输入密码不一致!")):r()},trigger:"blur"}]}}},methods:{cancel:function(){var a=this;this.dataForm={oldPassword:"",newPassword:"",newPassword2:""},this.$nextTick(function(){a.$refs.dataForm.clearValidate()})},change:function(){var a=this;this.$refs.dataForm.validate(function(t){t&&function(a){return Object(o.a)({method:"post",params:s()({_gp:"admin",_mt:"newPassword"},a)})}(a.dataForm).then(function(t){a.$notify.success({title:"成功",message:"修改密码成功"}),a.$store.dispatch("LogOut").then(function(){location.reload()})}).catch(function(t){a.$notify.error({title:"失败",message:t.data.errmsg})})})}}},l=e("KHd+"),d=Object(l.a)(n,function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"app-container"},[e("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:a.rules,model:a.dataForm,"status-icon":"","label-position":"left","label-width":"100px"}},[e("el-form-item",{attrs:{label:"原密码",prop:"oldPassword"}},[e("el-input",{attrs:{type:"password"},model:{value:a.dataForm.oldPassword,callback:function(t){a.$set(a.dataForm,"oldPassword",t)},expression:"dataForm.oldPassword"}})],1),a._v(" "),e("el-form-item",{attrs:{label:"新密码",prop:"newPassword"}},[e("el-input",{attrs:{type:"password","auto-complete":"off"},model:{value:a.dataForm.newPassword,callback:function(t){a.$set(a.dataForm,"newPassword",t)},expression:"dataForm.newPassword"}})],1),a._v(" "),e("el-form-item",{attrs:{label:"确认密码",prop:"newPassword2"}},[e("el-input",{attrs:{type:"password","auto-complete":"off"},model:{value:a.dataForm.newPassword2,callback:function(t){a.$set(a.dataForm,"newPassword2",t)},expression:"dataForm.newPassword2"}})],1)],1),a._v(" "),e("div",{staticStyle:{"margin-left":"100px"}},[e("el-button",{on:{click:a.cancel}},[a._v("取消")]),a._v(" "),e("el-button",{attrs:{type:"primary"},on:{click:a.change}},[a._v("确定")])],1)],1)},[],!1,null,null,null);d.options.__file="password.vue";t.default=d.exports}}]);