|
@@ -35,7 +35,9 @@ export default {
|
|
|
data: () => ({
|
|
|
display: 'none',
|
|
|
topTitle: '用户信息管理',
|
|
|
- ruleForm: {},
|
|
|
+ ruleForm: {
|
|
|
+ passwd: '123456',
|
|
|
+ },
|
|
|
}),
|
|
|
created() {
|
|
|
this.searchInfo();
|
|
@@ -54,23 +56,28 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 提交
|
|
|
- async submitForm(form) {
|
|
|
- let data = form;
|
|
|
+ async submitForm({ data }) {
|
|
|
let res;
|
|
|
if (this.id) {
|
|
|
res = await this.update(data);
|
|
|
- this.$message({
|
|
|
- message: '信息修改成功',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '信息修改成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
- res = await this.create({ ...data, passwd: 123456 });
|
|
|
- this.$message({
|
|
|
- message: '信息添加成功',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
+ res = await this.create(data);
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '信息创建成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- if (this.$checkRes(res)) this.$router.push({ path: '/otheruser/index' });
|
|
|
+ if (this.$checkRes(res)) this.resetForm();
|
|
|
+
|
|
|
+ console.log(res.data);
|
|
|
},
|
|
|
// 取消
|
|
|
resetForm() {
|