You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
844 B
Vue
50 lines
844 B
Vue
<script setup>
|
|
import {
|
|
onLaunch,
|
|
onShow,
|
|
onHide,
|
|
} from '@dcloudio/uni-app'
|
|
import {
|
|
getInfo,
|
|
getRouters
|
|
} from '@/api/user.js'
|
|
import {
|
|
setGlobalData
|
|
} from '@/store/index.js'
|
|
onLaunch(() => {
|
|
console.log('App Launch')
|
|
})
|
|
onShow(() => {
|
|
console.log('App Show')
|
|
getInfo().then(e => {
|
|
let data = e.data
|
|
setGlobalData('permissions', data.permissions)
|
|
setGlobalData('userInfo', data.user)
|
|
})
|
|
getRouters().then(e => {
|
|
let data = e.data.find(v => v.path === '/app')
|
|
setGlobalData('route', data.children)
|
|
})
|
|
})
|
|
onHide(() => {
|
|
console.log('App Hide')
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.form-item {
|
|
padding: 20rpx;
|
|
border-bottom: 1px solid #eee;
|
|
display: flex;
|
|
|
|
&:last-child {
|
|
margin-bottom: 10rpx;
|
|
}
|
|
}
|
|
|
|
.uni-input {
|
|
height: 60rpx;
|
|
line-height: 60rpx;
|
|
color: #aaa;
|
|
}
|
|
</style> |