'application/x-www-form-urlencoded', ]; // {"code":0,"message":"0","ttl":1,"data":{"url":"https://passport.bilibili.com/x/passport-tv-login/h5/qrcode/auth?auth_code=xxxx","auth_code":"xxxx"}} return Request::postJson(true, 'app', $url, Sign::login($payload), $headers); } /** * 验证登录 * @param string $auth_code * @return mixed */ public static function poll(string $auth_code): array { $url = 'https://passport.bilibili.com/x/passport-tv-login/qrcode/poll'; $payload = [ 'auth_code' => $auth_code, ]; $headers = [ 'content-type' => 'application/x-www-form-urlencoded', ]; // {"code":0,"message":"0","ttl":1,"data":{"mid":123,"access_token":"xxx","refresh_token":"xxx","expires_in":2592000}} return Request::postJson(true, 'app', $url, Sign::login($payload), $headers); } }