<template>

</template>

<script setup>
	import { afterLogin } from './util'
	import { onMounted } from 'vue'
	import college from '@/api/college'

	onMounted( async ()=>{
		const urlParams = new URLSearchParams(window.location.search);

		let userId = urlParams.get('userId');
		let type = urlParams.get('type');
		let id = urlParams.get('id');
		console.log('什么呢',userId)
		if (userId == undefined) {
			return
		}
		const params = new URLSearchParams({
			id
		});
		let token = await college.getToken({userId})
		console.log('token的呢',token)
		if(type == 0){
			afterLogin(token.data,'/')
		}else{
			console.log('什么呢路径',params.toString())
			afterLogin(token.data,`/portal/resourceDetails`,{id : id})
		}

	})

</script>

<style lang="less">
	@import 'login';
</style>
