perf: 支持oidc单点登录

This commit is contained in:
xiaojunnuo
2025-11-27 01:59:22 +08:00
parent c7b298c46f
commit ec75afbc44
25 changed files with 633 additions and 103 deletions
@@ -0,0 +1,45 @@
<template>
<div class="oauth-footer">
<div v-for="item in oauthList" :key="item.type">
<div class="oauth-icon-button pointer" @click="goOauthLogin(item.type)">
<el-icon :icon="item.icon" />
<span>{{ item.name }}</span>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import * as api from "./api";
const oauthList = ref([
{
name: "OIDC",
type: "oidc",
icon: "ion:oidc",
},
]);
async function goOauthLogin(type: string) {
//获取第三方登录URL
const res = await api.OauthLogin(type);
const loginUrl = res.loginUrl;
window.location.href = loginUrl;
}
</script>
<style lang="less">
.oauth-footer {
display: flex;
justify-content: center;
align-items: center;
gap: 16px;
.oauth-icon-button {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
padding: 8px 16px;
border-radius: 100px;
}
}
</style>