rename displayErrorPage method to displayError

This commit is contained in:
lichengyin 2015-12-25 15:18:40 +08:00
parent 08991c2b9e
commit 98fa0c2e2a
2 changed files with 13 additions and 13 deletions

View File

@ -8,7 +8,7 @@ module.exports = think.controller({
* @param {Number} status []
* @return {Promise} []
*/
displayErrorPage: function(status){
displayError: function(status){
//hide error message on production env
if(think.env === 'production'){
@ -41,7 +41,7 @@ module.exports = think.controller({
* @return {Promise} []
*/
_400Action: function(self){
return self.displayErrorPage(400);
return self.displayError(400);
},
/**
* Forbidden
@ -49,7 +49,7 @@ module.exports = think.controller({
* @return {Promise} []
*/
_403Action: function(self){
return self.displayErrorPage(403);
return self.displayError(403);
},
/**
* Not Found
@ -57,7 +57,7 @@ module.exports = think.controller({
* @return {Promise} []
*/
_404Action: function(self){
return self.displayErrorPage(404);
return self.displayError(404);
},
/**
* Internal Server Error
@ -65,7 +65,7 @@ module.exports = think.controller({
* @return {Promise} []
*/
_500Action: function(self){
return self.displayErrorPage(500);
return self.displayError(500);
},
/**
* Service Unavailable
@ -73,6 +73,6 @@ module.exports = think.controller({
* @return {Promise} []
*/
_503Action: function(self){
return self.displayErrorPage(503);
return self.displayError(503);
}
});

View File

@ -8,8 +8,8 @@ export default class extends think.controller.base {
* @param {Number} status []
* @return {Promise} []
*/
displayErrorPage(status){
displayError(status){
//hide error message on production env
if(think.env === 'production'){
this.http.error = null;
@ -40,34 +40,34 @@ export default class extends think.controller.base {
* @return {Promise} []
*/
_400Action(){
return this.displayErrorPage(400);
return this.displayError(400);
}
/**
* Forbidden
* @return {Promise} []
*/
_403Action(){
return this.displayErrorPage(403);
return this.displayError(403);
}
/**
* Not Found
* @return {Promise} []
*/
_404Action(){
return this.displayErrorPage(404);
return this.displayError(404);
}
/**
* Internal Server Error
* @return {Promise} []
*/
_500Action(){
return this.displayErrorPage(500);
return this.displayError(500);
}
/**
* Service Unavailable
* @return {Promise} []
*/
_503Action(){
return this.displayErrorPage(503);
return this.displayError(503);
}
}