commit | author | age
|
efef1c
|
1 |
<script> |
Z |
2 |
import config from './config' |
|
3 |
import store from '@/store' |
|
4 |
import { getToken } from '@/utils/auth' |
|
5 |
|
|
6 |
export default { |
|
7 |
onLaunch: function() { |
|
8 |
this.initApp() |
|
9 |
}, |
|
10 |
methods: { |
|
11 |
// 初始化应用 |
|
12 |
initApp() { |
|
13 |
// 初始化应用配置 |
|
14 |
this.initConfig() |
|
15 |
// 检查用户登录状态 |
|
16 |
//#ifdef H5 |
|
17 |
this.checkLogin() |
|
18 |
//#endif |
|
19 |
}, |
|
20 |
initConfig() { |
|
21 |
this.globalData.config = config |
|
22 |
}, |
|
23 |
checkLogin() { |
|
24 |
if (!getToken()) { |
|
25 |
this.$tab.reLaunch('/pages/login') |
|
26 |
} |
|
27 |
} |
|
28 |
} |
|
29 |
} |
|
30 |
</script> |
|
31 |
|
|
32 |
<style lang="scss"> |
|
33 |
@import '@/static/scss/index.scss' |
|
34 |
</style> |