feat:增加 social-login.vue 社交登录

This commit is contained in:
YunaiV
2025-04-10 22:23:41 +08:00
parent 2c105a21aa
commit 9fc51f085d
8 changed files with 310 additions and 14 deletions

View File

@@ -44,6 +44,7 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<{
submit: [Recordable<any>];
thirdLogin: [type: number];
}>();
const [Form, formApi] = useVbenForm(
@@ -80,6 +81,15 @@ function handleGo(path: string) {
router.push(path);
}
/**
* 处理第三方登录
*
* @param type 第三方平台类型
*/
function handleThirdLogin(type: number) {
emit('thirdLogin', type);
}
onMounted(() => {
if (localUsername) {
formApi.setFieldValue('username', localUsername);
@@ -168,7 +178,7 @@ defineExpose({
<!-- 第三方登录 -->
<slot name="third-party-login">
<ThirdPartyLogin v-if="showThirdPartyLogin" />
<ThirdPartyLogin v-if="showThirdPartyLogin" @third-login="handleThirdLogin" />
</slot>
<slot name="to-register">