feat:增加 social-login.vue 社交登录
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user