v4.0.18版本更新
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put, Query, UseGuards } from '@nestjs/common';
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put, Query, Res, UseGuards } from '@nestjs/common';
|
||||
import type { Response } from 'express';
|
||||
import { HqAuthGuard } from '../../common/guards/hq-auth.guard';
|
||||
import {
|
||||
HqPermissionGuard,
|
||||
@@ -80,6 +81,17 @@ export class AdminPartnersController {
|
||||
return this.assoc.listUsers(BigInt(id), Number(page) || 1, Number(pageSize) || 20);
|
||||
}
|
||||
|
||||
@Get(':id/assoc/qrcode')
|
||||
async assocQrcode(@Param('id') id: string, @Res() res: Response) {
|
||||
const { buffer, fileName } = await this.assoc.getQrcodeBuffer(BigInt(id));
|
||||
res.setHeader('Content-Type', 'image/png');
|
||||
res.setHeader(
|
||||
'Content-Disposition',
|
||||
`attachment; filename="${fileName}"; filename*=UTF-8''${encodeURIComponent(fileName)}`,
|
||||
);
|
||||
res.send(buffer);
|
||||
}
|
||||
|
||||
@Post(':id/assoc/qrcode')
|
||||
regenQrcode(@Param('id') id: string) {
|
||||
return this.assoc.ensureQrcode(BigInt(id), true);
|
||||
|
||||
Reference in New Issue
Block a user