From ce0c23bb8acbc1393d4f574ccdc326d0b3a0aaef Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sun, 26 Jul 2026 20:28:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bind=20=E6=8E=A5=E5=8F=A3=20code/printer?= =?UTF-8?q?=20=E6=94=B9=E4=B8=BA=E5=8F=AF=E9=80=89=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=88=E5=AE=9E=E9=99=85=E6=9C=AA=E4=BD=BF=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/auth.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controller/auth.js b/app/controller/auth.js index aba44f6..2d8a476 100644 --- a/app/controller/auth.js +++ b/app/controller/auth.js @@ -3,12 +3,14 @@ const Controller = require('egg').Controller; class AuthController extends Controller { async bind() { const { ctx, app } = this; - const { roomId, code, printer, warehouse, computerId } = ctx.request.body; + const { roomId, warehouse, computerId } = ctx.request.body; + const code = ctx.request.body.code || ''; + const printer = ctx.request.body.printer || ''; console.log('Received bind request with parameters:', { roomId, code, printer, warehouse, computerId }); - if (!roomId || !code || !printer || !warehouse || !computerId) { + if (!roomId || !warehouse || !computerId) { ctx.body = { status: 'fail', - message: '缺少必要参数: roomId, code, printer, warehouse, computerId', + message: '缺少必要参数: roomId, warehouse, computerId', }; return; }