main.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import Vue from 'vue'
  2. import App from './App'
  3. import uView from "uview-ui";
  4. import store from '@/store';
  5. import webim from 'webim.js';
  6. import * as filters from '@/filter/index.js'
  7. const vuexStore = require("@/store/$u.mixin.js");
  8. Vue.mixin(vuexStore);
  9. Vue.use(uView);
  10. Object.keys(filters).forEach(name=>{
  11. Vue.filter(name,filters[name])
  12. })
  13. Vue.config.productionTip = false
  14. Vue.prototype.$socket = webim;
  15. // Vue.prototype.$url = 'http://localhost:8081/upload/'
  16. // Vue.prototype.$uploadUrl = 'http://localhost:9998/file/upload'
  17. // Vue.prototype.$ws = 'ws://localhost:9999/chat'
  18. // Vue.prototype.$registerUrl = 'http://localhost:9998'
  19. Vue.prototype.$url = 'http://120.27.95.106:8081/upload/'
  20. Vue.prototype.$uploadUrl = 'http://120.27.95.106:9998/file/upload'
  21. Vue.prototype.$ws = 'ws://120.27.95.106:9999/chat'
  22. Vue.prototype.$registerUrl = 'http://120.27.95.106:9998'
  23. App.mpType = 'app'
  24. Promise.prototype.finally = function(callback) {
  25. let constructor = this.constructor;
  26. return this.then(function(value) {
  27. return constructor.resolve(callback()).then(function() {
  28. return value
  29. })
  30. }, function(issue) {
  31. return constructor.resolve(callback()).then(function() {
  32. throw issue
  33. })
  34. })
  35. }
  36. const app = new Vue({
  37. store,
  38. ...App
  39. })
  40. app.$mount()