且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AJAX:通过src加载视频的JWT身份验证

更新时间:2023-12-03 18:07:10

作为

As the answer to a similar question explains, this isn't possible. Either you need to do it as an AJAX request, which you previously did, but which was slow, or, you need to add additional methods for the server to accept authentication.

关于这些身份验证选项,您可以添加服务器可以检查的会话cookie,或将令牌附加到视频网址,例如response.url + '?token=' + token.

Regarding these auth options, you could add a session cookie that the server can check, or append the token to the video url, like response.url + '?token=' + token.