import App from './App' import uView from '@/uni_modules/uview-ui' import config from '@/config' const baseUrl = config.baseUrl Vue.prototype.$baseUrl = baseUrl; const baseImageUrl = config.baseImageUrl Vue.prototype.$baseImageUrl = baseImageUrl; const wsUrl = config.wsUrl Vue.prototype.$wsUrl = wsUrl; Vue.use(uView) import { connect, sendSocketMessage, closeSocket } from './utils/orderSocket.js' let SocketTask; let timerId; export function startSocketConnect(userId) { SocketTask = null SocketTask = connect(userId); Vue.prototype.$msgSocket = SocketTask console.log(SocketTask,211221); console.log(uni.getStorageSync('userId'),21212); if (!timerId && uni.getStorageSync('userId')) { timerId = setInterval(() => { sendSocketMessage(SocketTask) }, 10000); } } export function closeSocketMain(userId) { clearInterval(timerId) closeSocket(SocketTask); } Vue.prototype.$startSocketConnect = startSocketConnect Vue.prototype.$closeSocketMain = closeSocketMain Vue.prototype.$imgeUrl = 'http://www.nuoyunr.com/lananRsc'; // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount() // #endif // #ifdef VUE3 import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) return { app } } // #endif