added 规范接口错误码返回

This commit is contained in:
zhaoxiang 2016-11-08 17:32:52 +08:00
parent 802c5b5006
commit 2c83a44a49
2 changed files with 19 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class Menu extends Base {
],
'data' => [] //这个数据应该是从数据库中查出来
];
$this->result($table,200);
$this->result($table, ReturnCode::GET_TEMPLATE_SUCCESS);
}
public function add(){

View File

@ -0,0 +1,18 @@
<?php
/**
*
* @since 2016-02-18
* @author zhaoxiang <zhaoxiang051405@outlook.com>
*/
namespace app\admin\controller;
class ReturnCode {
const GET_TEMPLATE_SUCCESS = 200;
const SUCCESS = 1;
const ERROR = 0;
const GET_TEMPLATE_ERROR = 404;
}