- yilianyunapi.IsStrToken
This commit is contained in:
@@ -74,7 +74,7 @@ func (a *API) signParams(timestamp int64) string {
|
||||
}
|
||||
|
||||
func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}, token string) (retVal map[string]interface{}, err error) {
|
||||
if len(token) < len("d65578a6fa414d738e0c44f85ac4b950") {
|
||||
if !IsStrToken(token) {
|
||||
token = ""
|
||||
}
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||
@@ -239,3 +239,7 @@ func (a *API) GetPrinterToken(machineCode, qrKey string) (tokenInfo *TokenInfo,
|
||||
}
|
||||
return tokenInfo, err
|
||||
}
|
||||
|
||||
func IsStrToken(possibleToken string) bool {
|
||||
return len(possibleToken) >= len("d65578a6fa414d738e0c44f85ac4b950")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user