2024-03-04 17:53:39 +08:00
|
|
|
<?php
|
|
|
|
// 应用公共文件
|
2024-03-08 17:50:07 +08:00
|
|
|
/**
|
|
|
|
* 通用化API数据格式输出
|
|
|
|
* @param $status
|
|
|
|
* @param string $message
|
|
|
|
* @param array $data
|
|
|
|
* @param int $httpStatus
|
|
|
|
* @return \think\response\Json
|
|
|
|
*/
|
|
|
|
function show($status, $message = 'error', $data = [], $httpStatus = 200){
|
|
|
|
$result = [
|
|
|
|
"status" => $status,
|
|
|
|
"message" => $message,
|
|
|
|
"result" => $data
|
|
|
|
];
|
|
|
|
return json($result, $httpStatus);
|
|
|
|
}
|