[Update] 修改token有效期

pull/2408/head
ibuler 2019-02-19 10:29:25 +08:00
parent 2737675c36
commit f9a7cca478
1 changed files with 2 additions and 2 deletions

View File

@ -311,8 +311,8 @@ class User(AbstractUser):
token = cache.get('%s_%s' % (self.id, remote_addr))
if not token:
token = uuid.uuid4().hex
cache.set(token, self.id, expiration)
cache.set('%s_%s' % (self.id, remote_addr), token, expiration)
cache.set(token, self.id, expiration)
cache.set('%s_%s' % (self.id, remote_addr), token, expiration)
return token
def refresh_bearer_token(self, token):