fix: 固定文本换行为 LF,黄豆登录可选播放线路

This commit is contained in:
Nixevol
2026-10-25 02:11:55 +08:00
parent 3c2105c786
commit 3fe936fe70
6 changed files with 174 additions and 14 deletions
+8
View File
@@ -50,6 +50,7 @@ class LoginBody(BaseModel):
host: str = ""
username: str = ""
password: str = ""
line: str = ""
class AccountBody(BaseModel):
@@ -115,9 +116,16 @@ def save_accounts(body: SavedAccountsBody):
return {"accounts": hd_accounts.replace([item.model_dump() for item in body.accounts])}
@router.post("/lines")
def list_lines(body: TokenBody):
return call(lambda: {"lines": hd_playlist.available_lines(body.host)})
@router.post("/login")
def login(body: LoginBody):
def action():
client.play_line = (body.line or "").strip()
client.save()
entered = hd_login.enter(body.host)
if body.username.strip() and body.password:
return hd_login.login_account(body.username, body.password)