mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
added 规范接口错误码返回
This commit is contained in:
parent
802c5b5006
commit
2c83a44a49
@ -111,7 +111,7 @@ class Menu extends Base {
|
|||||||
],
|
],
|
||||||
'data' => [] //这个数据应该是从数据库中查出来
|
'data' => [] //这个数据应该是从数据库中查出来
|
||||||
];
|
];
|
||||||
$this->result($table,200);
|
$this->result($table, ReturnCode::GET_TEMPLATE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add(){
|
public function add(){
|
||||||
|
18
application/admin/controller/ReturnCode.php
Normal file
18
application/admin/controller/ReturnCode.php
Normal 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;
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user