feat(projects): 微调

This commit is contained in:
2026-06-17 19:27:17 +08:00
parent 1543bf76a9
commit 31344f1d58
18 changed files with 876 additions and 219 deletions

View File

@@ -11,9 +11,11 @@ import { normalizeProductMember, normalizeProductSettings } from './product-shar
const PRODUCT_PREFIX = `${WEB_SERVICE_PREFIX}/project/product`;
type ProductResponse = Omit<Api.Product.Product, 'id' | 'managerUserId'> & {
type ProductResponse = Omit<Api.Product.Product, 'id' | 'managerUserId' | 'currentUserRoles'> & {
id: string | number;
managerUserId?: string | number | null;
/** 灰度/兼容期后端可能缺省,适配层兜底为 [] */
currentUserRoles?: Api.Common.CurrentUserRole[] | null;
};
type ProductPageResponse = Api.Product.PageResult<ProductResponse>;
@@ -39,7 +41,8 @@ function normalizeProduct(product: ProductResponse): Api.Product.Product {
return {
...product,
id: normalizeStringId(product.id),
managerUserId: normalizeNullableStringId(product.managerUserId) ?? ''
managerUserId: normalizeNullableStringId(product.managerUserId) ?? '',
currentUserRoles: product.currentUserRoles ?? []
};
}