init
This commit is contained in:
21
utils/GlobalWebSocket.js
Normal file
21
utils/GlobalWebSocket.js
Normal file
@@ -0,0 +1,21 @@
|
||||
// function connectSocketAfterLogin() {
|
||||
// // 替换为你的Socket服务地址
|
||||
// const socketUrl =
|
||||
// 'ws://192.168.71.139:8080/resource/websocket?clientid=e5cd7e4891bf95d1d19206ce24a7b32e&Authorization=Bearer ' +
|
||||
// this.$store.state.vuex_token;
|
||||
// uni.connectSocket({
|
||||
// url: socketUrl,
|
||||
// header: {
|
||||
// 'content-type': 'application/json'
|
||||
// },
|
||||
// protocols: ['protocol1'],
|
||||
// method: 'GET'
|
||||
// });
|
||||
// uni.onSocketMessage(function(res) {
|
||||
// console.log('收到服务器内容:' + res.data);
|
||||
// });
|
||||
// uni.onError(function(err){
|
||||
// console.log('收到服务器错误内容:' + res.data);
|
||||
// })
|
||||
// }
|
||||
// export connectSocketAfterLogin;
|
Reference in New Issue
Block a user