odf_new/odf-uniapp/pages/start/index.vue

48 lines
1.0 KiB
Vue

<template>
<view class="start-page">
<text class="app-name">绥时录</text>
</view>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import store from '@/store'
import { checkPermission } from '@/services/auth'
onLoad(() => {
if (store.token) {
checkPermission().then((res) => {
if (res.code === 200) {
store.isPermission = true
uni.reLaunch({ url: '/pages/portal/index' })
} else if (res.code === 403) {
store.isPermission = false
uni.reLaunch({ url: '/pages/portal/index' })
} else if (res.code === 401) {
uni.reLaunch({ url: '/pages/login/index' })
}
}).catch(() => {
uni.reLaunch({ url: '/pages/login/index' })
})
} else {
uni.reLaunch({ url: '/pages/login/index' })
}
})
</script>
<style scoped>
.start-page {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #ffffff;
}
.app-name {
font-size: 48rpx;
font-weight: bold;
color: #1A73EC;
}
</style>