edu/app/src/App.vue

22 lines
638 B
Vue
Raw Normal View History

2022-08-26 09:52:43 +00:00
<script setup lang="ts">
2022-09-08 08:28:56 +00:00
import { onLaunch } from '@dcloudio/uni-app'
import { useAppStore } from './stores/app'
import { useUserStore } from './stores/user'
2022-09-15 02:53:31 +00:00
const appStore = useAppStore()
2022-09-08 08:28:56 +00:00
const { getUser } = useUserStore()
2022-09-13 09:41:24 +00:00
onLaunch(async () => {
2022-09-15 02:53:31 +00:00
await appStore.getConfig()
// #ifdef H5
const { status, close, url } = appStore.getH5Config
if (status == 0) {
if (close == 1) return (location.href = url)
uni.reLaunch({ url: '/pages/empty/empty' })
}
// #endif
2022-09-13 09:41:24 +00:00
await getUser()
2022-08-26 09:52:43 +00:00
})
</script>
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
</style>