Commit 754e81a6 authored by xinglei's avatar xinglei

增加前端提醒信息判断

parent 5445a432
...@@ -3,15 +3,14 @@ export default function(data, delRequest){ ...@@ -3,15 +3,14 @@ export default function(data, delRequest){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (data) { if (data) {
if (data.dataList || data.dataList === null){ if (data.dataList || data.dataList === null){
if(data.result==='SUCCESS'){ if (data.result === 'SUCCESS'){
resolve(data.dataList); resolve(data.dataList);
}else{ } else {
resolve(data.result); resolve(data);
} }
} else if (data.result || data.result === null){ } else if (data.result || data.result === null){
resolve(data.result); resolve(data.result);
}else{ } else {
resolve(data); resolve(data);
} }
} else { } else {
......
...@@ -205,7 +205,11 @@ class FireTruckDetailInfo extends Component { ...@@ -205,7 +205,11 @@ class FireTruckDetailInfo extends Component {
body: formData body: formData
}) })
.then(e => { .then(e => {
if (e.status === 200){
AmosAlert.success('提示', '保存成功'); AmosAlert.success('提示', '保存成功');
} else {
AmosAlert.error('错误', '保存失败');
}
this.goBack(); this.goBack();
}) })
.catch(e => { .catch(e => {
......
...@@ -313,7 +313,11 @@ class FireStationMatches extends Component { ...@@ -313,7 +313,11 @@ class FireStationMatches extends Component {
if(type === 'fireStation'){ if(type === 'fireStation'){
bindFireStationMatchesAction(bindObj).then( bindFireStationMatchesAction(bindObj).then(
data => { data => {
if (data.result === 'SUCCESS'){
AmosAlert.success('提示', '添加装备成功'); AmosAlert.success('提示', '添加装备成功');
} else if (data.result === 'FAILURE'){
AmosAlert.error('错误', data.message);
}
this.state.reload(); this.state.reload();
}, },
err => { err => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment