ws = new WebSocket(ws://${location.host}/xxx
)
ws.onopen = () => {
ws.send(JSON.stringify({
headers: {
Authorization: Bearer ${token}
}
}));
isConnected.value = true;
}
查看方法:在消息数据里(不是标头里)
ws = new WebSocket(ws://${location.host}/xxx
)
ws.onopen = () => {
ws.send(JSON.stringify({
headers: {
Authorization: Bearer ${token}
}
}));
isConnected.value = true;
}
查看方法:在消息数据里(不是标头里)