From cf7568ad5eceed26eacf82b94c5627467a3637c5 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 28 Aug 2025 21:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0q=E9=9F=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/qq_music/QPlayAutoManager.swift | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/local_plugins/qq_music/ios/qq_music/Sources/qq_music/QPlayAutoManager.swift b/local_plugins/qq_music/ios/qq_music/Sources/qq_music/QPlayAutoManager.swift index 8782d68c0..cfe893384 100644 --- a/local_plugins/qq_music/ios/qq_music/Sources/qq_music/QPlayAutoManager.swift +++ b/local_plugins/qq_music/ios/qq_music/Sources/qq_music/QPlayAutoManager.swift @@ -358,7 +358,7 @@ import QPlayAutoSDK return } -// if isLoginOK { + if isLoginOK { // 已登录,检查连接状态 if isConnected { // 已连接,直接执行操作 @@ -380,20 +380,21 @@ import QPlayAutoSDK } } } -// } else { -// // 未登录,先登录 -// print("QPlayAutoManager: 未登录,尝试登录...") -// performLogin { [weak self] success in -// guard let self = self else { return } -// if success { -// print("QPlayAutoManager: 登录成功,执行操作") -// operation() -// } else { -// print("QPlayAutoManager: 登录失败,无法执行操作") -// onFailure?(.loginFailed) -// } -// } -// } + } else { + // 未登录,先登录 + print("QPlayAutoManager: 未登录,尝试登录...") + performLogin { [weak self] success in + guard let self = self else { return } + if success { + print("QPlayAutoManager: 登录成功,执行操作") + operation() + } else { + print("QPlayAutoManager: 登录失败,无法执行操作") + onFailure?(.loginFailed) + stop() + } + } + } } private func performLogin(completion: @escaping (Bool) -> Void) {