diff --git a/apps/frontend/src/components/user/UserAuth.vue b/apps/frontend/src/components/user/UserAuth.vue index 41151ca..bbb731f 100644 --- a/apps/frontend/src/components/user/UserAuth.vue +++ b/apps/frontend/src/components/user/UserAuth.vue @@ -8,7 +8,7 @@ - + @@ -25,6 +25,7 @@ import { useI18n } from 'vue-i18n' import UserAuthIaaa from './UserAuthIaaa.vue' import UserAuthMail from './UserAuthMail.vue' import UserAuthPassword from './UserAuthPassword.vue' +import UserAuthSms from './UserAuthSms.vue' import { useMfa } from '@/stores/app' import { enableMfa } from '@/utils/flags' @@ -40,16 +41,13 @@ const { hasMfaToken, doVerify } = useMfa() const components: Record = { password: UserAuthPassword, mail: UserAuthMail, - iaaa: UserAuthIaaa + iaaa: UserAuthIaaa, + sms: UserAuthSms } -const login = useAsyncState( - () => http.get('auth/login').json<{ providers: string[]; signup: boolean }>(), - { - providers: [], - signup: false - } -) +const login = useAsyncState(() => http.get('auth/verify').json<{ providers: string[] }>(), { + providers: [] +}) @@ -58,6 +56,7 @@ en: provider-password: Password Login provider-mail: Email Login provider-iaaa: IAAA Login + provider-sms: SMS Login mfa-required: MFA Required do-verify: Verify zh-Hans: @@ -65,6 +64,7 @@ zh-Hans: provider-password: 密码登录 provider-mail: 邮箱登录 provider-iaaa: 北京大学统一身份认证 + provider-sms: 短信登录 mfa-required: 需要多因子身份认证 do-verify: 开始认证 diff --git a/apps/frontend/src/components/user/UserAuthSms.vue b/apps/frontend/src/components/user/UserAuthSms.vue new file mode 100644 index 0000000..a020518 --- /dev/null +++ b/apps/frontend/src/components/user/UserAuthSms.vue @@ -0,0 +1,56 @@ + + + + + +en: + code: Code + hint: + violate-phone-rule: Invalid phone number +zh-Hans: + code: 验证码 + hint: + violate-phone-rule: 无效的手机号 + diff --git a/apps/frontend/src/locales/zh-Hans.yml b/apps/frontend/src/locales/zh-Hans.yml index 2a58fdf..251b981 100644 --- a/apps/frontend/src/locales/zh-Hans.yml +++ b/apps/frontend/src/locales/zh-Hans.yml @@ -186,6 +186,7 @@ msg: recommended-browsers: 推荐的浏览器 registered: 已报名 not-registered: 未报名 + code-sent: 验证码已发送 tabs: description: 描述 diff --git a/apps/frontend/src/pages/auth/verify/index.vue b/apps/frontend/src/pages/auth/verify/index.vue index c8859f9..0162b47 100644 --- a/apps/frontend/src/pages/auth/verify/index.vue +++ b/apps/frontend/src/pages/auth/verify/index.vue @@ -1,10 +1,10 @@