123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- declare (strict_types = 1);
- namespace app\api\controller;
- use app\api\validate\IndexValidate;
- use app\common\BaseController;
- use app\common\Redis;
- use app\common\Request;
- use app\common\Token;
- use Curl\Curl;
- use GuzzleHttp\Client;
- use think\App;
- use think\facade\Db;
- class Index extends BaseController
- {
- public function __construct()
- {
- parent::__construct();
- $this->client = new Client();
- $this->curl = new Curl();
- }
- public function hello(Request $request)
- {
- (new IndexValidate())->goCheck($request->param(),'phone');
- return '123';
- }
-
- public function test()
- {
- $user = [
- 'id' => 1,
- 'phone' => '12345678910'
- ];
- //$re = \app\common\Token::getToken($user);
- //$re = \app\common\Token::getClientToken($user);
- //$re = \app\common\Token::refreshToken($user);
- // $re = Token::getTokenValue($token);
- $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ0cDYiLCJpYXQiOjE2MjAzNjk5NDcsImV4cCI6MTYyMDM3NzE0NywidXNlciI6eyJpZCI6MSwicGhvbmUiOiIxMjM0NTY3ODkxMCJ9fQ.err2aBVOeqTLnrpQ8p59BRNjKg95UJ-kAs7ktYP-VJI';
- //$re = $this->redis->hSet('check_token_phone',$user['phone'],$token);
- $re = $this->redis->hDel('check_token_phone',$user['phone']);
- dd($re);
- }
- }
|