feat:对接舆情监测相关接口
This commit is contained in:
@@ -22,5 +22,30 @@
|
||||
{ name: '舆情', path: '/sentiment' },
|
||||
{ name: '酒店' }
|
||||
]
|
||||
onMounted(() => {})
|
||||
onMounted(() => {
|
||||
let socket = new WebSocket('ws://36.138.38.16:81/ws/third-party', 'echo-protocol', {
|
||||
headers: {
|
||||
Authorization:
|
||||
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1OWFmNWYwLTU3OWItNDJkNy1hZDJhLTY0Y2JlODA5ZWI1NiJ9.BTxvu6jUWbN0qONWf5K6VzXopE8T8qXzKuX-mij21VJT4U0LdgnqToyqeNDQ2OyJ6cvpdJBzQ9mEEb-dnwrTpQ'
|
||||
}
|
||||
})
|
||||
socket.onopen = () => {
|
||||
console.log('WebSocket connected')
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
action: 'start',
|
||||
type: 'index'
|
||||
})
|
||||
)
|
||||
}
|
||||
socket.onerror = (error) => {
|
||||
console.error('WebSocket error:', error)
|
||||
}
|
||||
socket.onmessage = (message) => {
|
||||
console.log('Received message:', message.data)
|
||||
let data = JSON.parse(message.data)
|
||||
console.log('Received message:', data)
|
||||
}
|
||||
socket.onclose = () => {}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user