This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
let socket = io();
socket.on('connect', () => {
let persistToken = localStorage.getItem('playerToken')
if (persistToken) {
socket.emit('token:set', persistToken);
} else {
socket.emit('token:refresh');
}
});
socket.on('token:expired', () => { // token已过期,重载整个播放器
socket.on('token:update', (token) => { // 收到token
console.log('new token: ', token);
localStorage.setItem('playerToken', token)