优化代码

This commit is contained in:
wuxw 2022-07-19 23:42:26 +08:00
parent e895e134fc
commit a953eb8e7a

View File

@ -133,16 +133,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
$('#addAccessControlMachineModel').modal('hide'); $('#addAccessControlMachineModel').modal('hide');
vc.component.clearAddMachineInfo(); vc.component.clearAddMachineInfo();
vc.emit('accessControlMachineManage', 'listMachine', {}); vc.emit('accessControlMachineManage', 'listMachine', {});
return; return;
} }
vc.toast(json); vc.toast(_json.msg);
}, },
function(errInfo, error) { function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');