main.js 790 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. Vue.prototype.$navigateBack = uni.navigateBack;
  28. import field from './config/field.js'
  29. Vue.prototype.$field = field;
  30. Vue.config.productionTip = false;
  31. App.mpType = 'app';
  32. const app = new Vue({
  33. store,
  34. ...App
  35. })
  36. app.$mount()