组织机构可配置区域、类型、层级
支持cas登录
This commit is contained in:
40
src/views/secondDev/TokenLogin.vue
Normal file
40
src/views/secondDev/TokenLogin.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div style="width: 100%; height: 300px; display: flex;justify-content: center;align-items: center;">
|
||||
<a-spin />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const userStore = useUserStore();
|
||||
|
||||
onMounted(async () => {
|
||||
const fullPath = currentRoute.value.fullPath;
|
||||
let targetURL = ''
|
||||
let redirect = ''
|
||||
if (fullPath.includes('targetURL')) {
|
||||
const list = fullPath.split('targetURL=');
|
||||
targetURL = list[1];
|
||||
} else {
|
||||
const list = fullPath.split('redirect=');
|
||||
redirect = list[1];
|
||||
}
|
||||
let params = {...currentRoute.value.query, targetURL: targetURL,redirect: redirect, mode: 'none',goHome:true }; //不要默认的错误提示
|
||||
|
||||
const token=currentRoute.value.query?.token;
|
||||
//cas ticket的话走一遍后端换成token
|
||||
const ticket=currentRoute.value.query?.ticket;
|
||||
if(ticket){
|
||||
params.ticket=ticket;
|
||||
await userStore.casLogin(params);
|
||||
}else if (token) {
|
||||
await userStore.tokenLogin(token,params);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<style lang="less">
|
||||
</style>
|
||||
Reference in New Issue
Block a user