|
@@ -23,7 +23,9 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: login } = createNamespacedHelpers('login');
|
|
const { mapActions: login } = createNamespacedHelpers('login');
|
|
export default {
|
|
export default {
|
|
name: 'passwdDia',
|
|
name: 'passwdDia',
|
|
- props: {},
|
|
|
|
|
|
+ props: {
|
|
|
|
+ form: null,
|
|
|
|
+ },
|
|
components: {},
|
|
components: {},
|
|
data: function() {
|
|
data: function() {
|
|
return {
|
|
return {
|
|
@@ -31,20 +33,14 @@ export default {
|
|
oldpasswd: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
|
|
oldpasswd: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
|
|
newpasswd: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
|
newpasswd: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
|
},
|
|
},
|
|
- form: {},
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
- ...login({ loginUpdate: 'update' }),
|
|
|
|
submitForm(formName) {
|
|
submitForm(formName) {
|
|
this.$refs[formName].validate(async valid => {
|
|
this.$refs[formName].validate(async valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- this.form.id = this.user.id;
|
|
|
|
- let res = this.loginUpdate(this.form);
|
|
|
|
- if (this.$checkRes(res)) {
|
|
|
|
- this.$router.push('/login');
|
|
|
|
- }
|
|
|
|
|
|
+ this.$emit('submitForm', { data: this.form });
|
|
} else {
|
|
} else {
|
|
console.log('error submit!!');
|
|
console.log('error submit!!');
|
|
return false;
|
|
return false;
|