This commit is contained in:
邹宗楠
2024-01-16 16:24:50 +08:00
parent e3eff8739b
commit 1fe0ca13b0
7 changed files with 85 additions and 41 deletions

View File

@@ -397,10 +397,12 @@ func (c *PrinterHandler) UnregisterPrinter(ctx *jxcontext.Context, machineCode,
func (c *PrinterHandler) BindPrinter(ctx *jxcontext.Context, mapData map[string]interface{}) (bindResult *partner.BindPrinterResult, err error) {
machineCode := utils.Interface2String(mapData["machineCode"])
qrKey := utils.Interface2String(mapData["qrKey"])
if machineCode == "" || qrKey == "" {
msign := utils.Interface2String(mapData["msign"])
if machineCode == "" || (qrKey == "" && msign == "") {
return nil, fmt.Errorf("易联云扫描数据格式不正确")
}
tokenInfo, err := api.YilianyunAPI2.GetPrinterToken(machineCode, qrKey)
tokenInfo, err := api.YilianyunAPI2.GetPrinterToken(machineCode, qrKey, msign)
if err != nil {
return nil, err
}