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) {