|
@@ -26,13 +26,14 @@
|
|
|
<bind @bindDown="bindDown"></bind>
|
|
|
</el-dialog>
|
|
|
<el-dialog title="修改密码" :visible.sync="passwdDia" width="30%" :before-close="handleClose">
|
|
|
- <passwdDias></passwdDias>
|
|
|
+ <passwdDias :form="form" @submitForm="submitForm"></passwdDias>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: login } = createNamespacedHelpers('login');
|
|
|
import bind from './parts/bind.vue';
|
|
|
import passwdDias from './parts/passwdDia.vue';
|
|
|
export default {
|
|
@@ -54,13 +55,12 @@ export default {
|
|
|
bindDia: false,
|
|
|
// 修改密码
|
|
|
passwdDia: false,
|
|
|
+ form: {},
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- console.log('denglu');
|
|
|
- console.log(this.user);
|
|
|
- },
|
|
|
+ created() {},
|
|
|
methods: {
|
|
|
+ ...login({ loginUpdate: 'update', logout: 'logout' }),
|
|
|
// 绑定微信
|
|
|
bindBtn() {
|
|
|
this.bindDia = true;
|
|
@@ -69,9 +69,23 @@ export default {
|
|
|
passwdBtn() {
|
|
|
this.passwdDia = true;
|
|
|
},
|
|
|
+ // 修改密码提交
|
|
|
+ submitForm({ data }) {
|
|
|
+ data.id = this.user.id;
|
|
|
+ let res = this.loginUpdate(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.passwdDia = false;
|
|
|
+ this.$message({
|
|
|
+ message: '修改密码成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.logoutBtn();
|
|
|
+ }
|
|
|
+ },
|
|
|
// 退出登录
|
|
|
logoutBtn() {
|
|
|
- alert('退出登录');
|
|
|
+ this.logout();
|
|
|
+ location.reload();
|
|
|
},
|
|
|
// 绑定微信关闭
|
|
|
bindDown() {
|