Files

51 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2025-11-14 11:39:33 +08:00
import Vue from 'vue'
import App from './App'
import customNavbar from '@/components/navbar/customNavbar.vue'
import AuthLogin from "@/components/AuthPopup/AuthLogin.vue"
import PhoneSelect from "@/components/AuthPopup/PhoneSelect.vue"
2026-01-15 17:18:24 +08:00
import { ellipsisText } from '@/common/utils/text';
2025-11-14 11:39:33 +08:00
Vue.config.productionTip = false
App.mpType = 'app'
// 引入全局uView-plus
import uview from 'uview-ui'
Vue.use(uview)
// 此处为演示vuex使用非uView的功能部分
import store from '@/store';
// 引入uView提供的对vuex的简写法文件
let vuexStore = require('@/store/$u.mixin.js');
Vue.mixin(vuexStore);
// 引入uView对小程序分享的mixin封装
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)
Vue.component('customNavbar', customNavbar)
Vue.component('AuthLogin', AuthLogin)
Vue.component('PhoneSelect', PhoneSelect)
const app = new Vue({
store,
...App
})
// http拦截器将此部分放在new Vue()和app.$mount()之间才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js';
2025-12-25 08:26:09 +08:00
// 挂载自定义 http 封装
2025-11-14 11:39:33 +08:00
2025-12-25 08:26:09 +08:00
Vue.use(httpInterceptor, app);
2025-11-14 11:39:33 +08:00
// 封装自定义提示框
2026-01-15 17:18:24 +08:00
import $mytip from '@/common/utils/tip.js'
import config from "@/common/config.js"
import { checkToken,getToken,getUserType } from '@/common/utils/auth.js'
2025-11-14 11:39:33 +08:00
Vue.prototype.$mytip = $mytip
2026-01-15 17:18:24 +08:00
Vue.prototype.$ellipsis = ellipsisText
Vue.prototype.$config = config
Vue.prototype.$checkToken = checkToken
Vue.prototype.$getToken = getToken
Vue.prototype.$getUserType = getUserType
2025-11-14 11:39:33 +08:00
app.$mount()