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; }