fix(planting-service): 修复用户ID字段名与JwtAuthGuard一致
JwtAuthGuard 设置 req.user.id,controller 需要使用相同字段名 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a7dc85d8e1
commit
8b1db58318
|
|
@ -47,8 +47,8 @@ export class ContractSigningController {
|
|||
* 获取用户待签署的合同任务列表
|
||||
*/
|
||||
@Get('pending')
|
||||
async getPendingTasks(@Request() req: { user: { userId: string } }) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
async getPendingTasks(@Request() req: { user: { id: string } }) {
|
||||
const userId = BigInt(req.user.id);
|
||||
const tasks = await this.contractSigningService.getPendingTasks(userId);
|
||||
return {
|
||||
success: true,
|
||||
|
|
@ -61,8 +61,8 @@ export class ContractSigningController {
|
|||
* 用于App启动时检查
|
||||
*/
|
||||
@Get('unsigned')
|
||||
async getUnsignedTasks(@Request() req: { user: { userId: string } }) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
async getUnsignedTasks(@Request() req: { user: { id: string } }) {
|
||||
const userId = BigInt(req.user.id);
|
||||
const tasks = await this.contractSigningService.getUnsignedTasks(userId);
|
||||
return {
|
||||
success: true,
|
||||
|
|
@ -76,9 +76,9 @@ export class ContractSigningController {
|
|||
@Get('tasks/:orderNo')
|
||||
async getTask(
|
||||
@Param('orderNo') orderNo: string,
|
||||
@Request() req: { user: { userId: string } },
|
||||
@Request() req: { user: { id: string } },
|
||||
) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
const userId = BigInt(req.user.id);
|
||||
const task = await this.contractSigningService.getTask(orderNo, userId);
|
||||
|
||||
if (!task) {
|
||||
|
|
@ -101,9 +101,9 @@ export class ContractSigningController {
|
|||
@HttpCode(HttpStatus.OK)
|
||||
async markScrollComplete(
|
||||
@Param('orderNo') orderNo: string,
|
||||
@Request() req: { user: { userId: string } },
|
||||
@Request() req: { user: { id: string } },
|
||||
) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
const userId = BigInt(req.user.id);
|
||||
|
||||
try {
|
||||
await this.contractSigningService.markScrollComplete(orderNo, userId);
|
||||
|
|
@ -127,9 +127,9 @@ export class ContractSigningController {
|
|||
@HttpCode(HttpStatus.OK)
|
||||
async acknowledgeContract(
|
||||
@Param('orderNo') orderNo: string,
|
||||
@Request() req: { user: { userId: string } },
|
||||
@Request() req: { user: { id: string } },
|
||||
) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
const userId = BigInt(req.user.id);
|
||||
|
||||
try {
|
||||
await this.contractSigningService.acknowledgeContract(orderNo, userId);
|
||||
|
|
@ -154,9 +154,9 @@ export class ContractSigningController {
|
|||
async signContract(
|
||||
@Param('orderNo') orderNo: string,
|
||||
@Body() dto: SignContractDto,
|
||||
@Request() req: { user: { userId: string }; ip: string; headers: { 'user-agent'?: string } },
|
||||
@Request() req: { user: { id: string }; ip: string; headers: { 'user-agent'?: string } },
|
||||
) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
const userId = BigInt(req.user.id);
|
||||
const ipAddress = req.ip || 'unknown';
|
||||
const userAgent = req.headers['user-agent'] || 'unknown';
|
||||
|
||||
|
|
@ -195,9 +195,9 @@ export class ContractSigningController {
|
|||
async lateSignContract(
|
||||
@Param('orderNo') orderNo: string,
|
||||
@Body() dto: SignContractDto,
|
||||
@Request() req: { user: { userId: string }; ip: string; headers: { 'user-agent'?: string } },
|
||||
@Request() req: { user: { id: string }; ip: string; headers: { 'user-agent'?: string } },
|
||||
) {
|
||||
const userId = BigInt(req.user.userId);
|
||||
const userId = BigInt(req.user.id);
|
||||
const ipAddress = req.ip || 'unknown';
|
||||
const userAgent = req.headers['user-agent'] || 'unknown';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue