30 lines
		
	
	
		
			546 B
		
	
	
	
		
			PHP
		
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			546 B
		
	
	
	
		
			PHP
		
	
	
| <?php
 | |
| 
 | |
| namespace app\controller\api;
 | |
| 
 | |
| use app\controller\BaseController;
 | |
| 
 | |
| /**
 | |
|  * API控制器基础类
 | |
|  */
 | |
| class Base extends BaseController
 | |
| {
 | |
|     // 布尔值数字关系
 | |
|     public const BOOL_FALSE = 0;
 | |
|     public const BOOL_TRUE  = 1;
 | |
| 
 | |
|     protected function initialize()
 | |
|     {
 | |
|         parent::initialize();
 | |
| 
 | |
|         $this->middleware = [
 | |
|             'jwt',
 | |
|             'apiLogin' => ['except' => $this->noNeedLogin]
 | |
|         ];
 | |
|     }
 | |
| 
 | |
|     public function __call($method, $args)
 | |
|     {
 | |
|         return $this->json(4004, 'error request!');
 | |
|     }
 | |
| } |