main.js 743 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Vue from 'vue'
  2. import App from './App'
  3. import store from './store'
  4. import {
  5. dayjs
  6. } from '@/uni_modules/iRainna-dayjs/js_sdk/dayjs.min.js'
  7. Vue.prototype.$store = store;
  8. Vue.prototype.$dayjs = dayjs;
  9. Vue.prototype.$toast = msg => {
  10. uni.showToast({
  11. title: msg,
  12. icon: "none"
  13. })
  14. };
  15. Vue.prototype.$navigateTo = (url) => {
  16. if (!uni.getStorageSync('token')) {
  17. uni.showToast({
  18. title: '您暂未登录,请先登录~',
  19. icon: "none"
  20. });
  21. url = '/pages/login/login'
  22. }
  23. uni.navigateTo({
  24. url: url
  25. })
  26. }
  27. import field from './config/field.js'
  28. Vue.prototype.$field = field;
  29. Vue.config.productionTip = false;
  30. App.mpType = 'app';
  31. const app = new Vue({
  32. store,
  33. ...App
  34. })
  35. app.$mount()