Skip to content

Commit

Permalink
🔨 Fix: error msgs can be solved in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
lbgod2222 committed Jan 9, 2018
1 parent 773a773 commit 6846bcb
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 50 deletions.
6 changes: 0 additions & 6 deletions public/src/partials/addACL/addaclCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ angular.module('asch').controller('addaclCtrl', function ($scope, $rootScope, ap
$scope.addList = '';
toast($translate.instant('INF_OPERATION_SUCCEEDED'));
$scope.comfirmDialogClose();
} else {
toastError(res.error);
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {;
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
}
Expand Down
6 changes: 0 additions & 6 deletions public/src/partials/application/applicationCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,7 @@ angular.module('asch').controller('applicationCtrl', function ($scope, $rootScop
toast($translate.instant('DEPOSIT_SUCCESS'));
} else if(res.error.indexOf('Old address') != -1 || res.error.indexOf('old address') != -1 || res.error.indexOf('老地址') != -1 || res.error.indexOf('数字地址') != -1) {
toastError('dapp不支持老地址(数字地址),请用最新的字母地址(base58格式)');
} else {
toastError(res.error);
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
}
Expand Down
6 changes: 0 additions & 6 deletions public/src/partials/modal/assignee/assigneeCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ angular.module('asch').controller('assigneeCtrl', function ($scope, $rootScope,
$scope.Close();
toast($translate.instant('INF_REGISTER_SUCCESS'));
$scope.userName = '';
} else {
toastError(res.error);
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {;
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
};
Expand Down
6 changes: 0 additions & 6 deletions public/src/partials/modal/deletevote/deletevoteCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ angular.module('asch').controller('deletevoteCtrl', function ($scope, $rootScope
$scope.Close();
$rootScope.$emit('downvoteSuccess');
toast($translate.instant('INF_DELETE_SUCCESS'));
} else {
toastError(res.error);
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {;
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
};
Expand Down
6 changes: 0 additions & 6 deletions public/src/partials/modal/voteto/votetoCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ angular.module('asch').controller('votetoCtrl', function ($scope, $rootScope, ap
$scope.Close();
$rootScope.$emit('upvoteSuccess');
toast($translate.instant('INF_VOTE_SUCCESS'));
} else {
toastError(res.error)
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
};
Expand Down
14 changes: 5 additions & 9 deletions public/src/partials/pay/payCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,11 @@ angular.module('asch').controller('payCtrl', function ($scope, $rootScope, $filt
$scope.secondPassword = '';
toast($translate.instant('INF_TRANSFER_SUCCESS'));
} else {
toastError(res.error);
}
} else {
if (res.error.indexOf('Insufficient') > -1) {
toastError($translate.instant('ERR_BALANCE_NOT_ENOUGH'));
} else if(res.error.indexOf('locked') > -1) {
toastError($translate.instant('ALREADY_LOCKED'));
} else {
toastError($translate.instant('ERR_SERVER_ERROR'));
if (res.error.indexOf('Insufficient') > -1) {
toastError($translate.instant('ERR_BALANCE_NOT_ENOUGH'));
} else if(res.error.indexOf('locked') > -1) {
toastError($translate.instant('ALREADY_LOCKED'));
}
}
}
})
Expand Down
4 changes: 0 additions & 4 deletions public/src/partials/personal/personalCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ angular.module('asch').controller('personalCtrl', function ($scope, $rootScope,
} else {
toastError(res.error);
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
}
Expand Down
6 changes: 0 additions & 6 deletions public/src/partials/reduceACL/reduceaclCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ angular.module('asch').controller('reduceaclCtrl', function ($scope, $rootScope,
$scope.secondPassword = ''
toast($translate.instant('INF_OPERATION_SUCCEEDED'));
$scope.comfirmDialogClose();
} else {
toastError(res.error)
}
} else if(err === 'adjust'){
toastError($translate.instant('ADJUST_TIME_YOURSELF'));
} else {;
toastError($translate.instant('ERR_SERVER_ERROR'));
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion public/src/service/postSerivice.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ angular.module('asch').service('postSerivice', function ($http, $translate, $roo
console.log('broadcastTransaction-fail',data);
// 统一管理错误信息
translateErrMsg($rootScope.languageSelected,data.error);
callback(1, data);
callback(null, data);

}).error(function(data, status, headers, config){
retryOrCallbak(data);
Expand Down

0 comments on commit 6846bcb

Please sign in to comment.