27 lines
544 B
PHP
27 lines
544 B
PHP
<?php
|
|
|
|
namespace app\common\controller;
|
|
use app\exception\MyBusinessException;
|
|
use support\exception\BusinessException;
|
|
class ApiController
|
|
{
|
|
public $uid;
|
|
public $user_type;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->uid = input('uid');
|
|
$this->user_type = input('user_type');
|
|
}
|
|
|
|
public function success($data = [])
|
|
{
|
|
return json(['code' => 1, 'msg' => 'success', 'data' => $data]);
|
|
}
|
|
|
|
public function error($msg = 'fail')
|
|
{
|
|
return json(['code' => 0, 'msg' => $msg]);
|
|
}
|
|
|
|
} |