1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace app\admin\controller;
- use think\App;
- class Base extends \app\BaseController
- {
- public $post=[];
- public $uid='';
- public function __construct(App $app)
- {
- parent::__construct($app);
- $this->post =$this->request->post();
- $this->validateToken();
- }
- public function validateToken()
- {
- $token = isset($this->post['token']) ? trim($this->post['token']) : "";
- if($token==""){
- return error_show(101,'token不能为空');
- }
- $effetc = VerifyTokens($token);
- if(!empty($effetc) && $effetc['code']!=0) {
- return error_show($effetc['code'], $effetc['message']);
- }
- }
- }
|