Files
certd/packages/ui/certd-client/src/views/framework/oauth/oauth-footer.vue
T

86 lines
1.8 KiB
Vue
Raw Normal View History

2025-11-27 01:59:22 +08:00
<template>
2025-11-28 01:42:42 +08:00
<div class="oauth-footer relative">
<div class="oauth-title">
<div class="oauth-title-text">其他方式登录</div>
</div>
2025-11-27 01:59:22 +08:00
<div v-for="item in oauthList" :key="item.type">
2025-11-28 01:42:42 +08:00
<div class="oauth-icon-button pointer" @click="goOauthLogin(item.name)">
<div><fs-icon :icon="item.icon" class="text-blue-600 text-40" /></div>
<div>{{ item.title }}</div>
2025-11-27 01:59:22 +08:00
</div>
</div>
</div>
</template>
<script setup lang="ts">
2025-11-28 01:42:42 +08:00
import { onMounted, ref } from "vue";
2025-11-27 01:59:22 +08:00
import * as api from "./api";
2025-11-28 01:42:42 +08:00
const oauthList = ref([]);
onMounted(async () => {
oauthList.value = await api.GetOauthProviders();
});
2025-11-27 01:59:22 +08:00
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 {
2025-11-28 01:42:42 +08:00
width: 100%;
2025-11-27 01:59:22 +08:00
display: flex;
2025-11-28 01:42:42 +08:00
flex-direction: column;
2025-11-27 01:59:22 +08:00
justify-content: center;
align-items: center;
gap: 16px;
2025-11-28 01:42:42 +08:00
.oauth-title {
width: 100%;
font-size: 14px;
font-weight: 500;
color: #8c8c8c;
position: relative;
.oauth-title-text {
position: relative;
z-index: 1;
text-align: center;
&::after {
content: "";
position: absolute;
top: 50%;
left: 0;
width: 36%;
height: 0.5px;
background-color: #8c8c8c;
}
&::before {
content: "";
position: absolute;
top: 50%;
right: 0;
width: 36%;
height: 0.5px;
background-color: #8c8c8c;
}
}
}
2025-11-27 01:59:22 +08:00
.oauth-icon-button {
display: flex;
2025-11-28 01:42:42 +08:00
flex-direction: column;
2025-11-27 01:59:22 +08:00
justify-content: center;
align-items: center;
gap: 8px;
2025-11-28 01:42:42 +08:00
padding: 8px 8px;
2025-11-27 01:59:22 +08:00
border-radius: 100px;
2025-11-28 01:42:42 +08:00
.fs-icon {
font-size: 36px;
color: #006be6 !important;
}
2025-11-27 01:59:22 +08:00
}
}
</style>