update auth
This commit is contained in:
parent
abeb6ca085
commit
3c36acbba1
10 changed files with 223 additions and 161 deletions
|
|
@ -1,7 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { kcAuthen } from "@/plugins/keycloak";
|
||||
|
||||
import { setAuthen } from "@/plugins/auth";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -17,9 +18,12 @@ function setCookie(name: string, value: any, days: number) {
|
|||
|
||||
onMounted(async () => {
|
||||
if (route.query.token && route.query.accessToken) {
|
||||
// console.log('query', route.query.token)
|
||||
// console.log('accessToken', route.query.accessToken)
|
||||
kcAuthen(route.query.token.toString(), route.query.accessToken.toString());
|
||||
const params: any = await {
|
||||
access_token: route.query.token,
|
||||
expires_in: route.query.expires ? route.query.expires : 36000,
|
||||
refresh_token: route.query.accessToken,
|
||||
};
|
||||
setAuthen(params);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue