[style][V]:简化代码

master
Romesum 5 years ago
parent 9df456f9b1
commit a304eadc65

@ -69,30 +69,16 @@
await showDialog("确定要" + (this.edit ? '编辑' : '新增') + '吗?', this)
//
if (this.edit) {
await post('lb/user/updateUser', {
nickname: this.userForm.nickname,
tel: this.userForm.tel,
email: this.userForm.email,
username: this.userForm.username,
office: this.userForm.office,
position: parseInt(this.userForm.position),
uId: this.userForm.uid
}).catch(async e => {
//
this.userForm.uId = this.userForm.uid
await post('lb/user/updateUser', this.userForm).catch(async e => {
await showFail(e.msg, this)
await stop()
})
showSuccess('编辑完成', this)
} else {
//
await post('lb/user/addUser', {
nickname: this.userForm.nickname,
tel: this.userForm.tel,
email: this.userForm.email,
username: this.userForm.username,
office: this.userForm.office,
position: parseInt(this.userForm.position),
password: this.userForm.password
}).catch(async e => {
await post('lb/user/addUser', this.userForm).catch(async e => {
await showFail(e.msg, this)
await stop()
})

Loading…
Cancel
Save