Python/agent/application/states/auth.py

23 lines
379 B
Python

# -*- coding: utf-8 -*-
"""
认证状态
"""
import reflex as rx
class AuthState(rx.State):
"""
认证状态
"""
# 当前登录的用户唯一标识(通过本地存储同步)
user_id: str = rx.LocalStorage("user_id", sync=True)
@rx.event
async def authenticate(self) -> None:
"""
认证
"""
self.user_id = "1"