feat: update userapp utils
All checks were successful
Build and Deploy LTY / build-and-deploy (push) Successful in 11m52s
All checks were successful
Build and Deploy LTY / build-and-deploy (push) Successful in 11m52s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
29b4913723
commit
90c6feb5a5
@ -33,7 +33,7 @@ def send_sms(phone_number, code):
|
||||
def generate_token(user_id, is_admin=False):
|
||||
token = str(uuid.uuid4())
|
||||
prefix = "admin_token:" if is_admin else "token:"
|
||||
cache.set(f"{prefix}{token}", user_id, timeout=86400) # Token 有效期为1天
|
||||
cache.set(f"{prefix}{token}", user_id, timeout=2592000) # Token 有效期为30天
|
||||
return token
|
||||
|
||||
def get_user_id_from_token(token):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user