feat(log): Add message log retrieval functionality and update related typings

This commit is contained in:
web@ppanel
2025-02-13 21:25:21 +07:00
parent 13c33378aa
commit 1c0ecaecbd
84 changed files with 928 additions and 534 deletions
@@ -24,12 +24,9 @@ import { toast } from 'sonner';
import { z } from 'zod';
function MobileBindDialog({
method,
onSuccess,
children,
}: {
method?: API.UserAuthMethod;
onSuccess: () => void;
children: React.ReactNode;
}) {
@@ -47,8 +44,8 @@ function MobileBindDialog({
const form = useForm<MobileBindFormValues>({
resolver: zodResolver(formSchema),
defaultValues: {
area_code: method?.area_code || '1',
mobile: method?.auth_identifier || '',
area_code: '1',
mobile: '',
code: '',
},
});
@@ -270,7 +267,7 @@ export default function ThirdPartyAccounts() {
}}
/>
{account.id === 'mobile' ? (
<MobileBindDialog method={method} onSuccess={getUserInfo}>
<MobileBindDialog onSuccess={getUserInfo}>
<Button
variant={method?.auth_identifier ? 'outline' : 'default'}
className='whitespace-nowrap'
+1
View File
@@ -32,6 +32,7 @@ export async function appleLoginCallback(
return request<API.Response & { data?: any }>('/v1/auth/oauth/callback/apple', {
method: 'POST',
data: formData,
requestType: 'form',
...(options || {}),
});
}
+15
View File
@@ -193,6 +193,18 @@ declare namespace API {
token: string;
};
type MessageLog = {
id: number;
type: string;
platform: string;
to: string;
subject: string;
content: string;
status: number;
created_at: number;
updated_at: number;
};
type MobileAuthenticateConfig = {
enable: boolean;
limit: number;
@@ -300,6 +312,9 @@ declare namespace API {
type RegisterConfig = {
stop_register: boolean;
enable_trial: boolean;
trial_subscribe: number;
trial_time: number;
trial_time_unit: string;
enable_ip_register_limit: boolean;
ip_register_limit: number;
ip_register_limit_duration: number;
+15
View File
@@ -250,6 +250,18 @@ declare namespace API {
only_first_purchase: boolean;
};
type MessageLog = {
id: number;
type: string;
platform: string;
to: string;
subject: string;
content: string;
status: number;
created_at: number;
updated_at: number;
};
type MobileAuthenticateConfig = {
enable: boolean;
limit: number;
@@ -493,6 +505,9 @@ declare namespace API {
type RegisterConfig = {
stop_register: boolean;
enable_trial: boolean;
trial_subscribe: number;
trial_time: number;
trial_time_unit: string;
enable_ip_register_limit: boolean;
ip_register_limit: number;
ip_register_limit_duration: number;