统一规范状态码
This commit is contained in:
@@ -42,11 +42,12 @@ class OpenController
|
||||
/**
|
||||
* 失败返回json内容
|
||||
* @param string $msg
|
||||
* @param int $code 201=请携带token 202=缺少参数 203=token过期,默认400
|
||||
* @return Response
|
||||
*/
|
||||
public function fail(string $msg = 'fail'): Response
|
||||
public function fail(string $msg = 'fail', int $code = 400): Response
|
||||
{
|
||||
return json(['code' => 400, 'message' => $msg]);
|
||||
return json(['code' => $code, 'message' => $msg]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user