10/13新发现的
在重置密码模块也是差不多的问题 自己重置一下就可以了
<span slot="footer" class="dialog-footer">
<el-button size="medium" type="primary"
@click="resetPasswordShow= false;
resetPasswordValue=''">取 消</el-button>
<el-button size="medium" type="danger" @click="doResetPassword">确 定</el-button>
</span>
doResetPassword() {
// 检查密码不为空
if (this.resetPasswordValue === '') {
this.$message.error('新密码不能为空');
return;
}
api.resetPassword(this.targetUserId, hex_md5(this.resetPasswordValue)).then(result => {
if (result.code === api.success_code) {
this.resetPasswordShow = false;
this.$message.success(result.message);
this.resetPasswordValue = '';
} else {
this.$message.error(result.message);
this.resetPasswordValue = '';
}
})
}
分割线
在修门户的bug时无意中发现了一个管理中心的bug /(ㄒoㄒ)/~~
在课程中我们添加友链就是通过
<el-button type="primary" size="medium" @click="showFriendLinkDialog">添加友情链接</el-button>
showFriendLinkDialog() {
this.friendLinkDialogShow = true;
this.friendLinkEditorDialogCommitText = '添 加';
this.friendEditorTitle = '添加友情链接';
}
但是在后面的编辑过程中 我们引入了edit
<el-table-column
fixed="right"
label="操作"
width="200">
<template slot-scope="scope">
<el-button type="primary" size="medium" @click="edit(scope.row)">编辑</el-button>
<el-button type="danger" size="medium" @click="deleteItem(scope.row)">删除
</el-button>
</template>
</el-table-column>
this.friendLinkEditorDialogCommitText = '更 新';
this.friendEditorTitle = '更新友情链接';
// 回显数据
this.link.id = item.id;
this.link.name = item.name;
this.link.logo = item.logo;
this.link.order = item.order;
this.link.state = item.state;
this.link.url = item.url;
// 弹窗
this.friendLinkDialogShow = true;
},
不知道有没有注意到,在你点了edit后link就被赋值了,取消后并不会清空link。当你再点击添加时,link就不是空了。 所以只要在新建的地方将原来的link都置空即可。
showFriendLinkDialog() {
this.link.id = '';
this.link.name = '';
this.link.logo = '';
this.link.order = '';
this.link.state = '';
this.link.url = '';
this.friendLinkDialogShow = true;
this.friendLinkEditorDialogCommitText = '添 加';
this.friendEditorTitle = '添加友情链接';
},