|
@@ -76,7 +76,17 @@ const app = new OpenAPIHono<AuthContext>().openapi(createUploadPolicyRoute, asyn
|
|
|
uploadTime: new Date()
|
|
uploadTime: new Date()
|
|
|
};
|
|
};
|
|
|
const result = await fileService.createFile(fileData);
|
|
const result = await fileService.createFile(fileData);
|
|
|
- const typedResult = await parseWithAwait(CreateFileResponseSchema, result);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 处理响应数据,确保符合Schema要求
|
|
|
|
|
+ const processedResult = {
|
|
|
|
|
+ ...result,
|
|
|
|
|
+ file: {
|
|
|
|
|
+ ...result.file,
|
|
|
|
|
+ fullUrl: await result.file.fullUrl,
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const typedResult = await parseWithAwait(CreateFileResponseSchema, processedResult);
|
|
|
return c.json(typedResult, 200);
|
|
return c.json(typedResult, 200);
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
if (error instanceof z.ZodError) {
|
|
if (error instanceof z.ZodError) {
|