1
This commit is contained in:
@@ -237,12 +237,18 @@ func (a *API) GetPrintStatusWithToken(machineCode, token string) (state int, err
|
||||
return a.getPrintStatus(machineCode, token)
|
||||
}
|
||||
|
||||
func (a *API) GetPrinterToken(machineCode, qrKey string) (tokenInfo *TokenInfo, err error) {
|
||||
result, err := a.AccessAPI(scanCodemodelApiPath, map[string]interface{}{
|
||||
func (a *API) GetPrinterToken(machineCode, qrKey, msign string) (tokenInfo *TokenInfo, err error) {
|
||||
parameter := map[string]interface{}{
|
||||
"machine_code": machineCode,
|
||||
"qr_key": qrKey,
|
||||
"scope": "all",
|
||||
}, "")
|
||||
}
|
||||
if qrKey != "" {
|
||||
parameter["qr_key"] = qrKey
|
||||
} else if msign != "" {
|
||||
parameter["msign"] = msign
|
||||
}
|
||||
|
||||
result, err := a.AccessAPI(scanCodemodelApiPath, parameter, "")
|
||||
if err == nil {
|
||||
err = utils.Map2StructByJson(result, &tokenInfo, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user