Skip to content

Conversation

foxxorcat
Copy link
Member

Description / 描述

Motivation and Context / 背景

  1. 为189PC/TV 增加上Token/Session 刷新机制
  2. 为189PC 增加二维码登录
  3. 避免189TV 持久化TempUUID导致必须删除存储后才能重新加载二维码,限制是不能使用启用只能进去保存后生效

Closes #1166

How Has This Been Tested? / 测试

  1. HTTP请求满足时序要求
image
  1. 功能满足要求
image image

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

Copilot

This comment was marked as outdated.

foxxorcat and others added 2 commits September 2, 2025 00:28
Co-authored-by: Copilot <[email protected]>
Signed-off-by: foxxorcat <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: foxxorcat <[email protected]>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds refresh token functionality and QR code login capabilities for the 189PC and 189TV cloud storage drivers. The changes improve authentication mechanisms by implementing token refresh to avoid frequent re-authentication and adding QR code-based login as an alternative to password authentication.

  • Implements refresh token mechanism for both 189PC and 189TV drivers to maintain sessions without re-login
  • Adds QR code login functionality for 189PC driver as an alternative authentication method
  • Refactors login logic to support multiple authentication types and improve session management

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
drivers/189pc/utils.go Implements QR code login, token refresh logic, and session management improvements
drivers/189pc/types.go Adds new struct types for QR code login parameters and refactors login parameter structure
drivers/189pc/meta.go Adds login type selection and refresh token fields to driver configuration
drivers/189pc/help.go Adds date formatting utility function for QR code login requests
drivers/189pc/driver.go Updates driver initialization to support token refresh and adds cron job for session keep-alive
drivers/189_tv/utils.go Implements session refresh logic and keep-alive functionality
drivers/189_tv/meta.go Removes TempUuid from Addition struct (moved to driver struct)
drivers/189_tv/driver.go Adds cron job for session keep-alive and moves TempUuid to driver struct

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@foxxorcat
Copy link
Member Author

copilot 的上下文阅读还是太差了,只能分析单层代码,上面的修改建议全是通过局部推断的,不过用来检查拼写错误还行

@PIKACHUIM
Copy link
Member

感谢您的贡献,有几个事情想确认:
1、为189PC/TV 增加上Token/Session 刷新机制——这个是如何刷新的?
2、为189PC 增加二维码登录——这个可能会放到API站点上,二维码登录是获取refreshtoken吗
3、避免189TV 持久化TempUUID导致必须删除存储后才能重新加载二维码——这个解决什么问题

@foxxorcat
Copy link
Member Author

  1. 都是判断错误类型后被动刷新,在此基础上又加上了Session保活(两个都有)。189TV相比189PC少了个Token刷新,TV的token只有1个月有效期
  2. 对的,二维码扫描后获取refreshtoken保存后就行,但是这个回调地址是固定的所以api站上怕是用不了
  3. [BUG] 天翼云盘TV添加后过段时间出现session expired #1166 问题描述

Copy link
Member Author

@foxxorcat foxxorcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PC也可以加上最大尝试数量,虽然无限递归的可能挺低的

@Suyunmeng Suyunmeng merged commit c15ae94 into OpenListTeam:main Sep 13, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 天翼云盘TV添加后过段时间出现session expired
4 participants