mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
fix: QR login now persists cookies, shows server-generated QR image, passes timestamp
- Auth router accepts CookieStore and persists cookies on login - NeteaseProvider passes timestamp to prevent cached QR responses - QR image from server used directly (qrimg field) - Cookie saved to disk on confirmed QR scan Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f77a6f0fd7
commit
9755ba2909
6 files changed
+50
-14
No files matched your search
@@ -188,13 +188,16 @@ export class NeteaseProvider implements MusicProvider {
|
||||
}
|
||||
|
||||
async getQrCode(): Promise<QrCodeResult> {
|
||||
const keyRes = await this.api.get("/login/qr/key");
|
||||
const keyRes = await this.api.get("/login/qr/key", {
|
||||
params: { timestamp: Date.now() },
|
||||
});
|
||||
const key = keyRes.data?.data?.unikey ?? "";
|
||||
const createRes = await this.api.get("/login/qr/create", {
|
||||
params: { key, qrimg: true },
|
||||
});
|
||||
return {
|
||||
qrUrl: createRes.data?.data?.qrurl ?? "",
|
||||
qrImg: createRes.data?.data?.qrimg ?? "",
|
||||
key,
|
||||
};
|
||||
}
|
||||
@@ -203,7 +206,7 @@ export class NeteaseProvider implements MusicProvider {
|
||||
key: string
|
||||
): Promise<"waiting" | "scanned" | "confirmed" | "expired"> {
|
||||
const res = await this.api.get("/login/qr/check", {
|
||||
params: { key },
|
||||
params: { key, timestamp: Date.now() },
|
||||
});
|
||||
const code = res.data?.code;
|
||||
switch (code) {
|
||||
|
||||
Reference in new issue
Block a user