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.

38 lines
720 B

<?php
namespace app\base\controller\h5\api;
use app\base\model\mpalipay\MpalipayUser;
use think\App;
class Test extends Base
{
/**
* H5 一般用于开发环境通过user_id获取token
* @date 2020-11-30
*/
public function getTokenByUserId()
{
$user_id = input('post.user_id');
$jwt_class = new \jwt\Jwt();
//获取token
$info = [
'uid' => UID,
'user_id' => $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);
}
}