main.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Vue from "vue";
  2. import App from "./App.vue";
  3. import router from "./router";
  4. import store from "./store";
  5. import api from './util/api.js'
  6. import moment from 'moment';
  7. import {VueJsonp} from 'vue-jsonp';
  8. import OSS from 'ali-oss';
  9. import Vant from 'vant';
  10. import 'vant/lib/index.css';
  11. import {IMSDKCode} from './util/index.js';
  12. import TIM from 'tim-js-sdk';
  13. import Recorder from 'js-audio-recorder';
  14. Vue.use(Vant);
  15. Vue.use(VueJsonp)
  16. Vue.prototype.$recorder=new Recorder({
  17. sampleBits: 16, // 采样位数,支持 8 或 16,默认是16
  18. sampleRate: 16000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
  19. numChannels: 1, // 声道,支持 1 或 2, 默认是1
  20. });;
  21. Vue.prototype.$store=store;
  22. Vue.prototype.$api=api;
  23. Vue.prototype.$moment=moment;
  24. Vue.prototype.$oss=OSS;
  25. Vue.prototype.$EventBus = new Vue();
  26. Vue.config.productionTip = false;
  27. Vue.prototype.$TUIKit = TIM.create({
  28. SDKAppID: IMSDKCode
  29. });
  30. Vue.prototype.$TUIKitTIM = TIM;
  31. Vue.prototype.$TUIKitEvent = TIM.EVENT;
  32. Vue.prototype.$TUIKitVersion = TIM.VERSION;
  33. Vue.prototype.$TUIKitTypes = TIM.TYPES; // 监听系统级事件
  34. new Vue({
  35. router,
  36. store,
  37. render: (h) => h(App),
  38. }).$mount("#app");