From 95607991755ddd5dfc741a780f157467e0db3302 Mon Sep 17 00:00:00 2001 From: foxxorcat <95907542+foxxorcat@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:33:15 +0800 Subject: [PATCH] fix(189pc): InvalidSessionKey (#6994 close #6992) --- drivers/189pc/utils.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/189pc/utils.go b/drivers/189pc/utils.go index a000a84e005..f5a44455d2e 100644 --- a/drivers/189pc/utils.go +++ b/drivers/189pc/utils.go @@ -114,17 +114,19 @@ func (y *Cloud189PC) request(url, method string, callback base.ReqCallback, para if err = y.refreshSession(); err != nil { return nil, err } - return y.request(url, method, callback, params, resp) + return y.request(url, method, callback, params, resp, isFamily...) + } + + // if erron.ErrorCode == "InvalidSessionKey" || erron.Code == "InvalidSessionKey" { + if strings.Contains(res.String(), "InvalidSessionKey") { + if err = y.refreshSession(); err != nil { + return nil, err + } + return y.request(url, method, callback, params, resp, isFamily...) } // 处理错误 if erron.HasError() { - if erron.ErrorCode == "InvalidSessionKey" { - if err = y.refreshSession(); err != nil { - return nil, err - } - return y.request(url, method, callback, params, resp) - } return nil, &erron } return res.Body(), nil