perf(notice): 优化公告增改接口返回状态判断

This commit is contained in:
KingMo 2022-08-16 13:45:43 +08:00
parent 716992e971
commit 986885cfc9
2 changed files with 7 additions and 3 deletions

View File

@ -129,13 +129,15 @@
}, },
function (json, res) { function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) { let _json = JSON.parse(json)
if (_json.code == 0) {
//关闭model //关闭model
vc.component.clearaddNoticeViewInfo(); vc.component.clearaddNoticeViewInfo();
vc.emit('noticeManage', 'listNotice', {}); vc.emit('noticeManage', 'listNotice', {});
vc.toast("添加成功") vc.toast("添加成功")
return; return;
} }
vc.toast(_json.msg);
}, },
function (errInfo, error) { function (errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');

View File

@ -114,12 +114,14 @@
}, },
function (json, res) { function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) { let _json = JSON.parse(json)
if (_json.code == 0) {
//关闭model //关闭model
vc.emit('noticeManage', 'listNotice', {}); vc.emit('noticeManage', 'listNotice', {});
vc.toast("修改成功"); vc.toast("修改成功");
return; return;
} }
vc.toast(_json.msg);
}, },
function (errInfo, error) { function (errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');