You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
631 B
35 lines
631 B
<?php
|
|
|
|
namespace app\base\controller\h5\api;
|
|
|
|
use think\App;
|
|
|
|
class Auth extends Base
|
|
{
|
|
|
|
/**
|
|
* H5生成TOKEN
|
|
* @date 2020-11-30
|
|
*/
|
|
public function getToken()
|
|
{
|
|
$param = input('post.');
|
|
|
|
$jwt_class = new \jwt\Jwt();
|
|
|
|
//获取token
|
|
$info = [
|
|
'uid' => UID,
|
|
'user_id' => $param['user_id'],
|
|
];
|
|
$res_token = $jwt_class->signToken($info);
|
|
|
|
$r_data = $info;
|
|
$r_data['access_token'] = $res_token['token'];
|
|
$r_data['access_token_expire_time'] = $res_token['exp'];
|
|
|
|
return sendSuccessMessage($r_data);
|
|
}
|
|
|
|
}
|