mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-06 03:50:47 +08:00
fix: setup 迁移完成 v1
This commit is contained in:
@@ -2,24 +2,20 @@
|
||||
<CallbackPage />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import CallbackPage from '~/components/CallbackPage.vue'
|
||||
import { githubExchange } from '~/utils/github'
|
||||
|
||||
export default {
|
||||
name: 'GithubCallbackPageView',
|
||||
components: { CallbackPage },
|
||||
async mounted() {
|
||||
const url = new URL(window.location.href)
|
||||
const code = url.searchParams.get('code')
|
||||
const state = url.searchParams.get('state')
|
||||
const result = await githubExchange(code, state, '')
|
||||
onMounted(async () => {
|
||||
const url = new URL(window.location.href)
|
||||
const code = url.searchParams.get('code')
|
||||
const state = url.searchParams.get('state')
|
||||
const result = await githubExchange(code, state, '')
|
||||
|
||||
if (result.needReason) {
|
||||
this.$router.push('/signup-reason?token=' + result.token)
|
||||
} else {
|
||||
this.$router.push('/')
|
||||
}
|
||||
},
|
||||
}
|
||||
if (result.needReason) {
|
||||
navigateTo(`/signup-reason?token=${result.token}`, { replace: true })
|
||||
} else {
|
||||
navigateTo('/', { replace: true })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user