Skip to content

Commit

Permalink
fix avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
zcpua committed Jul 16, 2023
1 parent 5c8c0c9 commit c0db833
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ export class AppController {

@Post('avatar')
@UseInterceptors()
async Avatar(@Body() data: AvatarBody, @Res() res: Response) {
this.MjService.Avatar(data.img, (uri: string) => {
res.write(JSON.stringify({ uri }));
async Avatar(@Body() data: AvatarBody, @Res() res: FastifyReply) {
const msg = await this.MjService.Avatar(data.img, (uri: string) => {
res.raw.write(JSON.stringify({ uri }));
});
res.end();
res.raw.write(JSON.stringify(msg));
res.raw.end();
}
}

0 comments on commit c0db833

Please sign in to comment.