fix token
Showing
2 changed files
with
7 additions
and
7 deletions
| ... | @@ -34,10 +34,10 @@ class CMS: | ... | @@ -34,10 +34,10 @@ class CMS: |
| 34 | rh.set_cms_token(self.token, expires) | 34 | rh.set_cms_token(self.token, expires) |
| 35 | 35 | ||
| 36 | def get_token(self): | 36 | def get_token(self): |
| 37 | # if self.token is None: | ||
| 38 | self.token = rh.get_cms_token() | ||
| 37 | if self.token is None: | 39 | if self.token is None: |
| 38 | self.token = rh.get_cms_token() | 40 | self.update_token() |
| 39 | if self.token is None: | ||
| 40 | self.update_token() | ||
| 41 | return self.token | 41 | return self.token |
| 42 | 42 | ||
| 43 | def send(self, payload): | 43 | def send(self, payload): | ... | ... |
| ... | @@ -59,11 +59,11 @@ class ECM: | ... | @@ -59,11 +59,11 @@ class ECM: |
| 59 | rh.set_ecm_token(self.oauth_token, expires) | 59 | rh.set_ecm_token(self.oauth_token, expires) |
| 60 | 60 | ||
| 61 | def get_oauth_token(self): | 61 | def get_oauth_token(self): |
| 62 | if self.oauth_token is None: | 62 | # if self.oauth_token is None: |
| 63 | # redis获取token | 63 | # redis获取token |
| 64 | self.oauth_token = rh.get_ecm_token() | 64 | self.oauth_token = rh.get_ecm_token() |
| 65 | if self.oauth_token is None: | 65 | if self.oauth_token is None: |
| 66 | self.update_oauth_token() | 66 | self.update_oauth_token() |
| 67 | return self.oauth_token | 67 | return self.oauth_token |
| 68 | 68 | ||
| 69 | def get_headers(self): | 69 | def get_headers(self): | ... | ... |
-
Please register or sign in to post a comment