Files
yunzhupaas-app-vue3/pages/login/sso-redirect.vue
wangmingwei 35101db700 初始代码
2026-04-21 16:55:00 +08:00

43 lines
643 B
Vue

<template>
<view class="">
</view>
</template>
<script>
import {
useUserStore
} from '@/store/modules/user'
export default {
data() {
return {
token: ''
}
},
onLoad(e) {
this.token = e.token
this.init()
},
methods: {
init() {
const userStore = useUserStore()
userStore.setToken(this.token)
userStore.getCurrentUser().then((res) => {
uni.hideLoading()
uni.switchTab({
url: '/pages/index/index'
});
this.show = false
}).catch(() => {
uni.hideLoading()
uni.switchTab({
url: '/pages/login/index'
});
})
}
}
}
</script>
<style>
</style>