fix(admin): match flat API response shape, no nested data envelope

This commit is contained in:
2026-07-09 15:52:40 +08:00
parent 64c8964ea4
commit 7e4f06058c

View File

@@ -49,13 +49,11 @@ interface OrgTreeWithUsersResponse {
interface ImportUsersResponse {
success: boolean;
data: {
teacherCount: number;
studentCount: number;
classCount: number;
skipped: number;
warnings: string[];
};
teacherCount: number;
studentCount: number;
classCount: number;
skipped: number;
warnings: string[];
}
interface ClassMarkForm {
@@ -355,8 +353,7 @@ const IntegrationConfigPage: React.FC = () => {
users: usersPayload,
};
const res: any = await api.post('/sync/dingtalk/import-users', payload);
const data = res.data;
const data: any = await api.post('/sync/dingtalk/import-users', payload);
message.success(
`导入完成:${data.teacherCount} 位老师,${data.studentCount} 位学生` +
(data.classCount ? `${data.classCount} 个班级` : '') +