-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
51 lines (36 loc) · 872 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Vue from 'vue'
import App from './App'
import store from './store'
Vue.prototype.$store = store
Vue.config.productionTip = false
//引入全局组件
import divider from "@/components/common/divider.vue"
Vue.component("divider", divider)
import loading from '@/components/common/loading.vue';
Vue.component("loading", loading)
// 引入request库
import $H from '@/common/lib/request.js';
Vue.prototype.$H = $H
// 权限跳转
Vue.prototype.navigateTo = (options) => {
// 判断用户是否登录
if (!store.state.user.loginStatus) {
uni.showToast({
title: '请先登录',
icon: "none"
});
return uni.navigateTo({
url: '/pages/login/login',
});
}
uni.navigateTo(options)
}
import $U from './common/lib/util.js';
// 更新tabbat角标
Vue.prototype.$U = $U
App.mpType = 'app'
const app = new Vue({
store,
...App
})
app.$mount()