fix: 固定文本换行为 LF,黄豆登录可选播放线路
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user