diff --git a/src/views/login/components/LoginForm.vue b/src/views/login/components/LoginForm.vue new file mode 100644 index 000000000..6c235f45a --- /dev/null +++ b/src/views/login/components/LoginForm.vue @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ t('login.remember') }} + + + + {{ t('login.forgetPassword') }} + + + + + + + + + + + + + + + + + diff --git a/src/views/login/components/LoginFormTitle.vue b/src/views/login/components/LoginFormTitle.vue new file mode 100644 index 000000000..cdf4facce --- /dev/null +++ b/src/views/login/components/LoginFormTitle.vue @@ -0,0 +1,26 @@ + + + {{ getFormTitle }} + + + diff --git a/src/views/login/components/MobileForm.vue b/src/views/login/components/MobileForm.vue new file mode 100644 index 000000000..ebb36b84e --- /dev/null +++ b/src/views/login/components/MobileForm.vue @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ t('login.getSmsCode') }} + + + {{ mobileCodeTimer }}秒后可重新获取 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/login/components/QrCodeForm.vue b/src/views/login/components/QrCodeForm.vue new file mode 100644 index 000000000..31d28453e --- /dev/null +++ b/src/views/login/components/QrCodeForm.vue @@ -0,0 +1,30 @@ + + + + + + + + + + + {{ t('login.qrcode') }} + + + + + + + + diff --git a/src/views/login/components/RegisterForm.vue b/src/views/login/components/RegisterForm.vue new file mode 100644 index 000000000..23b3bd428 --- /dev/null +++ b/src/views/login/components/RegisterForm.vue @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/login/components/SSOLogin.vue b/src/views/login/components/SSOLogin.vue new file mode 100644 index 000000000..f31ab0e5f --- /dev/null +++ b/src/views/login/components/SSOLogin.vue @@ -0,0 +1,199 @@ + + + + + + + + + + + 此第三方应用请求获得以下权限: + + + + {{ formatScope(scope) }} + + + + + + + 同意授权 + 授 权 中... + + 拒绝 + + + + + + diff --git a/src/views/login/components/index.ts b/src/views/login/components/index.ts new file mode 100644 index 000000000..204ad73d0 --- /dev/null +++ b/src/views/login/components/index.ts @@ -0,0 +1,8 @@ +import LoginForm from './LoginForm.vue' +import MobileForm from './MobileForm.vue' +import LoginFormTitle from './LoginFormTitle.vue' +import RegisterForm from './RegisterForm.vue' +import QrCodeForm from './QrCodeForm.vue' +import SSOLoginVue from './SSOLogin.vue' + +export { LoginForm, MobileForm, LoginFormTitle, RegisterForm, QrCodeForm, SSOLoginVue } diff --git a/src/views/login/components/useLogin.ts b/src/views/login/components/useLogin.ts new file mode 100644 index 000000000..b4a02f8f1 --- /dev/null +++ b/src/views/login/components/useLogin.ts @@ -0,0 +1,42 @@ +import { Ref } from 'vue' + +export enum LoginStateEnum { + LOGIN, + REGISTER, + RESET_PASSWORD, + MOBILE, + QR_CODE, + SSO +} + +const currentState = ref(LoginStateEnum.LOGIN) + +export function useLoginState() { + function setLoginState(state: LoginStateEnum) { + currentState.value = state + } + const getLoginState = computed(() => currentState.value) + + function handleBackLogin() { + setLoginState(LoginStateEnum.LOGIN) + } + + return { + setLoginState, + getLoginState, + handleBackLogin + } +} + +export function useFormValid(formRef: Ref) { + async function validForm() { + const form = unref(formRef) + if (!form) return + const data = await form.validate() + return data as T + } + + return { + validForm + } +} diff --git a/src/views/login/login.vue b/src/views/login/login.vue new file mode 100644 index 000000000..a0025ab66 --- /dev/null +++ b/src/views/login/login.vue @@ -0,0 +1,104 @@ + + + + + + + + {{ underlineToHump(appStore.getTitle) }} + + + + + + {{ t('login.welcome') }} + + {{ t('login.message') }} + + + + + + + + + + {{ underlineToHump(appStore.getTitle) }} + + + + + + + + + + + + + + + + + + + + + + + + + + + +