6ba8d65d by 周伟奇

fix token

1 parent cc6c63c8
......@@ -34,10 +34,10 @@ class CMS:
rh.set_cms_token(self.token, expires)
def get_token(self):
# if self.token is None:
self.token = rh.get_cms_token()
if self.token is None:
self.token = rh.get_cms_token()
if self.token is None:
self.update_token()
self.update_token()
return self.token
def send(self, payload):
......
......@@ -59,11 +59,11 @@ class ECM:
rh.set_ecm_token(self.oauth_token, expires)
def get_oauth_token(self):
if self.oauth_token is None:
# if self.oauth_token is None:
# redis获取token
self.oauth_token = rh.get_ecm_token()
if self.oauth_token is None:
self.update_oauth_token()
self.oauth_token = rh.get_ecm_token()
if self.oauth_token is None:
self.update_oauth_token()
return self.oauth_token
def get_headers(self):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!