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.
import useUserInfo from "~/composables/useUserInfo";
import useApi from "~/composables/useApi";
import io from 'socket.io-client'
export default function useSocket(){
// new Promise((resolve)=>{
// debugger
const user = useUserInfo()
const {translateApi} = useApi()
// 连接服务端
const socket = io('http://research.mcnetmart.com:2120');//这里请填写你的域名,外网,端口为socket端口
socket.on('connect', function () {
//@ts-ignore
this.emit('login', user.$state.info.id);
});
// 后端推送来消息时
return socket;
// })
}