feat: 天河链去掉元数据上链存证改为仅发行NFT(feature用作品主图)
This commit is contained in:
@@ -24,11 +24,15 @@ function requestMeta(raw: unknown): Record<string, unknown> | undefined {
|
||||
return meta && typeof meta === 'object' ? (meta as Record<string, unknown>) : undefined;
|
||||
}
|
||||
|
||||
function productInfo(raw: unknown): { productId: string; name: string; author?: string } | undefined {
|
||||
function productInfo(
|
||||
raw: unknown,
|
||||
): { productId: string; name: string; author?: string; feature?: string } | undefined {
|
||||
if (!raw || typeof raw !== 'object') return undefined;
|
||||
const product = (raw as Record<string, unknown>).product as { productId?: string; name?: string; author?: string } | undefined;
|
||||
const product = (raw as Record<string, unknown>).product as
|
||||
| { productId?: string; name?: string; author?: string; feature?: string }
|
||||
| undefined;
|
||||
return product?.productId && product?.name
|
||||
? { productId: product.productId, name: product.name, author: product.author }
|
||||
? { productId: product.productId, name: product.name, author: product.author, feature: product.feature }
|
||||
: undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user