-
Notifications
You must be signed in to change notification settings - Fork 52
/
App.vue
43 lines (38 loc) · 887 Bytes
/
App.vue
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
<script>
/**
* vuex管理登陆状态,具体可以参考官方登陆模板示例
*/
import app from 'app.js'
import {mapMutations} from 'vuex'
export default {
onLaunch: function () {
app.initTitleNav();
app.initShareMenu();
this.$api.backend.getLoginUser().then(resp => {
if (resp.responseCode === 7002) {
this.logout();
} else {
this.storeUser(resp.data)
}
})
},
onShow: function (res) {
if (res.shareTicket) {
this.storeShareTicket(res.shareTicket)
}
},
onHide: function () {
},
methods: {
...mapMutations(['storeUser', 'logout', 'storeShareTicket'])
}
}
</script>
<style lang="scss">
@import "colorui/icon.css";
@import "colorui/main.css";
@import "style/app.scss";
.container {
background: $page-color-base;
}
</style>