feat: 新增邮箱登录
This commit is contained in:
parent
cf1ee9cbb0
commit
53644936d2
@ -6,12 +6,12 @@ import { reactive, ref } from 'vue';
|
|||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { login } from '@/api';
|
import { login } from '@/api';
|
||||||
import { useUserStore } from '@/stores';
|
import { useUserStore } from '@/stores';
|
||||||
import { useLoginFromStore } from '@/stores/modules/loginFrom';
|
import { useLoginFormStore } from '@/stores/modules/loginForm';
|
||||||
import { useSessionStore } from '@/stores/modules/session';
|
import { useSessionStore } from '@/stores/modules/session';
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const sessionStore = useSessionStore();
|
const sessionStore = useSessionStore();
|
||||||
const loginFromStore = useLoginFromStore();
|
const loginFromStore = useLoginFormStore();
|
||||||
|
|
||||||
const formRef = ref<FormInstance>();
|
const formRef = ref<FormInstance>();
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import type { RegisterDTO } from '@/api/auth/types';
|
|||||||
import { useCountdown } from '@vueuse/core';
|
import { useCountdown } from '@vueuse/core';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { emailCode, register } from '@/api';
|
import { emailCode, register } from '@/api';
|
||||||
import { useLoginFromStore } from '@/stores/modules/loginFrom';
|
import { useLoginFormStore } from '@/stores/modules/loginForm';
|
||||||
|
|
||||||
const loginFromStore = useLoginFromStore();
|
const loginFromStore = useLoginFormStore();
|
||||||
const countdown = shallowRef(60);
|
const countdown = shallowRef(60);
|
||||||
const { start, stop, resume } = useCountdown(countdown, {
|
const { start, stop, resume } = useCountdown(countdown, {
|
||||||
onComplete() {
|
onComplete() {
|
||||||
|
|||||||
@ -3,13 +3,13 @@ import { ref, watch } from 'vue';
|
|||||||
import logoPng from '@/assets/images/logo.png';
|
import logoPng from '@/assets/images/logo.png';
|
||||||
import SvgIcon from '@/components/SvgIcon/index.vue';
|
import SvgIcon from '@/components/SvgIcon/index.vue';
|
||||||
import { useUserStore } from '@/stores';
|
import { useUserStore } from '@/stores';
|
||||||
import { useLoginFromStore } from '@/stores/modules/loginFrom';
|
import { useLoginFormStore } from '@/stores/modules/loginForm';
|
||||||
import AccountPassword from './components/FormLogin/AccountPassword.vue';
|
import AccountPassword from './components/FormLogin/AccountPassword.vue';
|
||||||
import RegistrationForm from './components/FormLogin/RegistrationForm.vue';
|
import RegistrationForm from './components/FormLogin/RegistrationForm.vue';
|
||||||
import QrCodeLogin from './components/QrCodeLogin/index.vue';
|
import QrCodeLogin from './components/QrCodeLogin/index.vue';
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const loginFromStore = useLoginFromStore();
|
const loginFromStore = useLoginFormStore();
|
||||||
|
|
||||||
const loginFormType = computed(() => loginFromStore.LoginFormType);
|
const loginFormType = computed(() => loginFromStore.LoginFormType);
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
|||||||
|
|
||||||
type LoginFormType = 'AccountPassword' | 'VerificationCode' | 'RegistrationForm';
|
type LoginFormType = 'AccountPassword' | 'VerificationCode' | 'RegistrationForm';
|
||||||
|
|
||||||
export const useLoginFromStore = defineStore('loginFrom', () => {
|
export const useLoginFormStore = defineStore('loginForm', () => {
|
||||||
const LoginFormType = ref<LoginFormType>('AccountPassword');
|
const LoginFormType = ref<LoginFormType>('AccountPassword');
|
||||||
|
|
||||||
// 设置登录表单类型
|
// 设置登录表单类型
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user