import Vue from 'vue' import App from './App' import store from './store' import { dayjs } from '@/uni_modules/iRainna-dayjs/js_sdk/dayjs.min.js' Vue.prototype.$store = store; Vue.prototype.$dayjs = dayjs; Vue.prototype.$toast = msg => { uni.showToast({ title: msg, icon: "none" }) }; Vue.prototype.$navigateTo = (url) => { if (!uni.getStorageSync('token')) { uni.showToast({ title: '您暂未登录,请先登录~', icon: "none" }); url = '/pages/login/login' } uni.navigateTo({ url: url }) } Vue.prototype.$navigateBack = uni.navigateBack; import field from './config/field.js' Vue.prototype.$field = field; import { YeIMUniSDK, YeIMUniSDKDefines } from '@/uni_modules/wzJun1-YeIM-Uni-SDK/js_sdk/yeim-uni-sdk.min.js' //初始化YeIMUniSDK uni.$YeIMUniSDKDefines = YeIMUniSDKDefines; uni.$YeIM = YeIMUniSDK.init({ baseURL: 'https://www.waywish.com/im', // YeIMServer http url (如无特殊需求,服务端启动后仅需修改ip或者域名即可) socketURL: 'wss://www.waywish.com/im/im', // YeIMServer socket url(如无特殊需求,服务端启动后仅需修改ip或者域名即可) /** * 日志等级 * 0 普通日志,日志量较多,接入时建议使用 * 1 关键性日志,日志量较少,生产环境时建议使用 * 2 无日志级别,SDK 将不打印任何日志 */ logLevel: 0, // 日志等级, reConnectInterval: 3000, // 重连时间间隔 reConnectTotal: 99, // 最大重连次数,0不限制一直重连 heartInterval: 35000, //心跳时间间隔(默认30s) }); Vue.config.productionTip = false; App.mpType = 'app'; const app = new Vue({ store, ...App }) app.$mount()