mirror of
https://github.com/certd/certd.git
synced 2026-05-17 13:57:31 +08:00
perf: 支持oidc单点登录
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user