fix: bind 接口 code/printer 改为可选参数(实际未使用)
This commit is contained in:
parent
fc9e514f93
commit
ce0c23bb8a
@ -3,12 +3,14 @@ const Controller = require('egg').Controller;
|
|||||||
class AuthController extends Controller {
|
class AuthController extends Controller {
|
||||||
async bind() {
|
async bind() {
|
||||||
const { ctx, app } = this;
|
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 });
|
console.log('Received bind request with parameters:', { roomId, code, printer, warehouse, computerId });
|
||||||
if (!roomId || !code || !printer || !warehouse || !computerId) {
|
if (!roomId || !warehouse || !computerId) {
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
status: 'fail',
|
status: 'fail',
|
||||||
message: '缺少必要参数: roomId, code, printer, warehouse, computerId',
|
message: '缺少必要参数: roomId, warehouse, computerId',
|
||||||
};
|
};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user