refactor: restructure authentication components and routes
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 13s

- Removed the old reset password form component and replaced it with a new implementation.
- Updated routing paths for login, registration, and reset password to be under a common auth path.
- Added new login and registration pages with corresponding forms.
- Introduced a common auth header component for consistent branding across auth pages.
- Implemented a current logged-in user display component.
- Enhanced the register form to include email verification and captcha.
- Updated translations for new and modified components.
- Refactored the navigation bar to include user avatar dropdown and improved menu structure.
This commit is contained in:
2025-09-23 02:21:03 +08:00
parent 0f7cbb385a
commit 349cf5a5b7
23 changed files with 380 additions and 112 deletions

View File

@ -1,6 +1,6 @@
import type { OidcConfig } from '@/models/oidc-config'
import type { BaseResponse } from '@/models/resp'
import type { RegisterRequest, User } from '@/models/user'
import type { User } from '@/models/user'
import { CaptchaProvider } from '@/models/captcha'
import axiosClient from './client'
@ -31,11 +31,18 @@ export async function userLogout(): Promise<BaseResponse<null>> {
}
export async function userRegister(
data: RegisterRequest,
{ username, password, email, verifyCode, captchaToken }: {
username: string
password: string
email: string
verifyCode?: string
captchaToken?: string
},
): Promise<BaseResponse<{ token: string, user: User }>> {
const res = await axiosClient.post<BaseResponse<{ token: string, user: User }>>(
'/user/register',
data,
{ username, password, },
{ headers: { 'X-Email': email, 'X-VerifyCode': verifyCode || '' , 'X-Captcha-Token': captchaToken || ''} },
)
return res.data
}