123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import Vue from 'vue';
- import App from './App';
- import GoEasy from '@/uni_modules/GOEASY-IM/js_sdk/goeasy-2.13.21.esm.min.js'
- import GRTC from './lib/goeasy-rtc-0.3.7.esm.min.js'
- import request from '@/utils/request.js'
- Vue.prototype.$http = request.http
- Vue.prototype.$request =request
- GoEasy.init({
- host:"hangzhou.goeasy.io",//应用所在的区域地址: 【hangzhou.goeasy.io |singapore.goeasy.io】
- appkey:"BC-729fefdf1ad7417daea8e62b9fce3f74",// common key
- modules: ['im'],
- // true表示支持通知栏提醒,false则表示不需要通知栏提醒
- allowNotification: true //仅有效于app,小程序和H5将会被自动忽略
- });
- GRTC.init(GoEasy);
- uni.$GoEasy = GoEasy;
- uni.$GRTC = GRTC;
- GoEasy.onClickNotification((message) => {
- let currentUrl;
- const routes = getCurrentPages();
- if (routes && routes.length) {
- const curRoute = routes[routes.length - 1].route;
- const curParam = routes[routes.length - 1].options;
- currentUrl = '/' + curRoute + `?to=${curParam.to}`;
- }
- let newUrl;
- switch (message.toType) {
- case GoEasy.IM_SCENE.PRIVATE:
- newUrl = '/pages/privateChat?to=' + message.senderId;
- break;
- case GoEasy.IM_SCENE.GROUP:
- newUrl = '/pages/groupChat?to=' + message.groupId;
- break;
- }
- if (currentUrl !== newUrl) {
- uni.navigateTo({
- url: newUrl,
- });
- }
- });
- Vue.config.productionTip = false;
- App.mpType = 'app';
- const app = new Vue({
- ...App
- });
- app.$mount();
|