fix: preserve takeover and share token integrity
This commit is contained in:
@@ -20,7 +20,7 @@ class Avatar(Base):
|
||||
photo_url = Column(String, default="")
|
||||
emoji = Column(String, default="🤖")
|
||||
status = Column(String, default="active") # active | inactive | training
|
||||
share_token = Column(String, default="", unique=True, index=True) # 对外分享使用的不可猜测令牌
|
||||
share_token = Column(String, nullable=True, default=None, unique=True, index=True) # 对外分享使用的不可猜测令牌
|
||||
token_balance = Column(Integer, default=0)
|
||||
config = Column(JSON, default=dict)
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
@@ -36,7 +36,7 @@ class Avatar(Base):
|
||||
"photoUrl": self.photo_url,
|
||||
"emoji": self.emoji,
|
||||
"status": self.status,
|
||||
"shareToken": self.share_token,
|
||||
"shareToken": self.share_token or "",
|
||||
"tokenBalance": self.token_balance,
|
||||
"config": self.config or {},
|
||||
"createdAt": _iso(self.created_at),
|
||||
|
||||
Reference in New Issue
Block a user