phpvue/app/Http/Controllers/ApiController.php

22 lines
428 B
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ApiController extends Controller
{
protected function create($msg = '', $code = 200, $data = [])
{
$result = [
// 返回状态码
'code'=>$code,
// 返回提示信息
'msg'=>$msg,
// 返回数据
'data'=>$data,
];
return response($result);
}
}