Commit f9a7cca4 authored by ibuler's avatar ibuler

[Update] 修改token有效期

parent 2737675c
...@@ -311,8 +311,8 @@ class User(AbstractUser): ...@@ -311,8 +311,8 @@ class User(AbstractUser):
token = cache.get('%s_%s' % (self.id, remote_addr)) token = cache.get('%s_%s' % (self.id, remote_addr))
if not token: if not token:
token = uuid.uuid4().hex token = uuid.uuid4().hex
cache.set(token, self.id, expiration) cache.set(token, self.id, expiration)
cache.set('%s_%s' % (self.id, remote_addr), token, expiration) cache.set('%s_%s' % (self.id, remote_addr), token, expiration)
return token return token
def refresh_bearer_token(self, token): def refresh_bearer_token(self, token):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment