odf_new/odf-uniapp/pages/start/index.vue
zpc cdc4a78198
Some checks reported errors
continuous-integration/drone/push Build encountered an error
1.2.0
2026-04-20 14:20:30 +08:00

52 lines
1.2 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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'
import { loadConfig } from '@/services/api'
onLoad(async () => {
// 先加载运行时配置BASE_URL 等),再发任何请求
await loadConfig()
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: transparent;
}
.app-name {
font-size: 48rpx;
font-weight: bold;
color: #1A73EC;
}
</style>