-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathApp.vue
73 lines (68 loc) · 1.46 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<script>
import {
useSettingStore
} from '@/stores/settings.js'
import {
useUserStore
} from '@/stores/user.js'
import {
mapActions,
mapGetters,
} from 'pinia'
export default {
async onLaunch() {
const res = await this.getSettings()
console.log('App Launch', res, this.security)
// 需要登录才能访问,且没登录,则跳转到登录页面
if(this.security.login_required && !this.user.id){
uni.redirectTo({
url: '/pages/login/login'
})
}
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
computed:{
...mapGetters(useSettingStore, ['security']),
...mapGetters(useUserStore, ['user'])
},
methods:{
...mapActions(useSettingStore,['getSettings'])
}
}
</script>
<style lang="scss">
@import url(static/css/moredoc.css);
page{
background-color: $uni-bg-color-grey;
}
.text-danger{
color: red;
}
.m-card{
background-color: #ffffff;
border-radius: $uni-border-radius-lg !important;
box-sizing: border-box;
overflow: hidden;
.m-card-header{
padding: $uni-spacing-col-base;
font-size: $uni-font-size-base;
border-bottom: 1px solid $uni-bg-color-hover;
}
.m-card-body{
padding: $uni-spacing-col-base;
}
}
// 隐藏滚动条
::-webkit-scrollbar{
display: none !important;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none !important;
background-color: transparent !important;
}
</style>