main.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import App from './App'
  2. import store from './store'
  3. import uView from "@/node_modules/uview-ui";
  4. import {isEmpty,parseIDCardInfo,parseText,urlToObj,clearHisSearch,getHisSearch,addHisSearch,logout,getDictLabelName,getProvider,parsePhone,isLogin,getAge,parseIdCard,isLoginCourse,reLoginCheck} from './utils/common.js'
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. // Vuex 插件注册
  8. import Vuex from 'vuex'
  9. Vue.config.productionTip = false
  10. App.mpType = 'app'
  11. Vue.use(Vuex)
  12. Vue.use(uView);
  13. Vue.prototype.$getProvider = getProvider;
  14. Vue.prototype.$parsePhone = parsePhone;
  15. Vue.prototype.$isLogin = isLogin;
  16. Vue.prototype.$isEmpty = isEmpty;
  17. Vue.prototype.$getAge = getAge;
  18. Vue.prototype.$parseIdCard = parseIdCard;
  19. Vue.prototype.$getDictLabelName = getDictLabelName;
  20. Vue.prototype.$parseText = parseText;
  21. Vue.prototype.$logout = logout;
  22. Vue.prototype.$clearHisSearch = clearHisSearch
  23. Vue.prototype.$getHisSearch = getHisSearch
  24. Vue.prototype.$addHisSearch = addHisSearch
  25. Vue.prototype.$urlToObj = urlToObj
  26. Vue.prototype.$parseText = parseText
  27. Vue.prototype.$parseIDCardInfo = parseIDCardInfo
  28. Vue.prototype.$isLoginCourse = isLoginCourse
  29. Vue.prototype.$reLoginCheck = reLoginCheck
  30. // Vue.prototype.$formatHour = formatHour;
  31. // Vue.prototype.$updateMsgDot = updateMsgDot;
  32. const app = new Vue({
  33. store,
  34. ...App
  35. })
  36. // 引入请求封装
  37. require("./pages_im/util/request/index")(app);
  38. app.$mount()
  39. // #endif
  40. // #ifdef VUE3
  41. import { createSSRApp } from 'vue'
  42. import uviewPlus from '@/uni_modules/uview-plus'
  43. export function createApp() {
  44. const app = createSSRApp(App)
  45. app.config.globalProperties.$getProvider = getProvider
  46. app.config.globalProperties.$parsePhone = parsePhone
  47. app.config.globalProperties.$isLogin = isLogin
  48. app.config.globalProperties.$isEmpty = isEmpty
  49. app.config.globalProperties.$getAge = getAge
  50. app.config.globalProperties.$parseIdCard = parseIdCard
  51. app.config.globalProperties.$getDictLabelName = getDictLabelName
  52. app.config.globalProperties.$logout = logout
  53. app.config.globalProperties.$clearHisSearch = clearHisSearch
  54. app.config.globalProperties.$getHisSearch = getHisSearch
  55. app.config.globalProperties.$addHisSearch = addHisSearch
  56. app.config.globalProperties.$urlToObj = urlToObj
  57. app.config.globalProperties.$parseText = parseText
  58. app.config.globalProperties.$parseIDCardInfo = parseIDCardInfo
  59. app.config.globalProperties.$isLoginCourse = isLoginCourse
  60. app.use(uviewPlus)
  61. return {
  62. app
  63. }
  64. }
  65. // #endif