fix: 结构时null不会被使用

This commit is contained in:
dap 2024-09-30 10:04:26 +08:00
parent 5cb1e36fba
commit a09234071f
2 changed files with 3 additions and 9 deletions

View File

@ -91,7 +91,7 @@ export interface UserInfoResponse {
roleIds?: string[];
roles: Role[];
postIds?: number[];
posts: Post[];
posts?: Post[];
}
/**

View File

@ -139,14 +139,8 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
},
]);
// &&
const {
postIds = [],
posts = [],
roleIds = [],
roles = [],
user,
} = await findUserInfo(id);
const postOptions = posts.map((item) => ({
const { postIds, posts, roleIds, roles, user } = await findUserInfo(id);
const postOptions = (posts ?? []).map((item) => ({
label: item.postName,
value: item.postId,
}));