mirror of
https://github.com/ctwj/urldb.git
synced 2025-11-25 03:15:04 +08:00
update: pan
This commit is contained in:
@@ -256,9 +256,9 @@ func (a *AlipanService) DeleteFiles(fileList []string) (*TransferResult, error)
|
||||
}
|
||||
|
||||
// GetUserInfo 获取用户信息
|
||||
func (a *AlipanService) GetUserInfo(cookie string) (*UserInfo, error) {
|
||||
func (a *AlipanService) GetUserInfo(cookie *string) (*UserInfo, error) {
|
||||
// 设置Cookie
|
||||
a.SetHeader("Cookie", cookie)
|
||||
a.SetHeader("Cookie", *cookie)
|
||||
|
||||
// 获取access token
|
||||
accessToken, err := a.manageAccessToken()
|
||||
|
||||
@@ -52,9 +52,9 @@ func (b *BaiduPanService) DeleteFiles(fileList []string) (*TransferResult, error
|
||||
}
|
||||
|
||||
// GetUserInfo 获取用户信息
|
||||
func (b *BaiduPanService) GetUserInfo(cookie string) (*UserInfo, error) {
|
||||
func (b *BaiduPanService) GetUserInfo(cookie *string) (*UserInfo, error) {
|
||||
// 设置Cookie
|
||||
b.SetHeader("Cookie", cookie)
|
||||
b.SetHeader("Cookie", *cookie)
|
||||
|
||||
// 调用百度网盘用户信息API
|
||||
userInfoURL := "https://pan.baidu.com/api/gettemplatevariable"
|
||||
|
||||
@@ -91,7 +91,7 @@ type PanService interface {
|
||||
DeleteFiles(fileList []string) (*TransferResult, error)
|
||||
|
||||
// GetUserInfo 获取用户信息
|
||||
GetUserInfo(ck string) (*UserInfo, error)
|
||||
GetUserInfo(ck *string) (*UserInfo, error)
|
||||
|
||||
GetUserInfoByEntity(entity entity.Cks) (*UserInfo, error)
|
||||
|
||||
|
||||
@@ -943,10 +943,10 @@ type PasswordResult struct {
|
||||
}
|
||||
|
||||
// GetUserInfo 获取用户信息
|
||||
func (q *QuarkPanService) GetUserInfo(cookie string) (*UserInfo, error) {
|
||||
func (q *QuarkPanService) GetUserInfo(cookie *string) (*UserInfo, error) {
|
||||
// 临时设置cookie
|
||||
originalCookie := q.GetHeader("Cookie")
|
||||
q.SetHeader("Cookie", cookie)
|
||||
q.SetHeader("Cookie", *cookie)
|
||||
defer q.SetHeader("Cookie", originalCookie) // 恢复原始cookie
|
||||
|
||||
// 获取用户基本信息
|
||||
|
||||
@@ -52,9 +52,9 @@ func (u *UCService) DeleteFiles(fileList []string) (*TransferResult, error) {
|
||||
}
|
||||
|
||||
// GetUserInfo 获取用户信息
|
||||
func (u *UCService) GetUserInfo(cookie string) (*UserInfo, error) {
|
||||
func (u *UCService) GetUserInfo(cookie *string) (*UserInfo, error) {
|
||||
// 设置Cookie
|
||||
u.SetHeader("Cookie", cookie)
|
||||
u.SetHeader("Cookie", *cookie)
|
||||
|
||||
// 调用UC网盘用户信息API
|
||||
userInfoURL := "https://drive.uc.cn/api/user/info"
|
||||
|
||||
@@ -708,11 +708,11 @@ func (x *XunleiPanService) DeleteFiles(fileList []string) (*TransferResult, erro
|
||||
}
|
||||
|
||||
// GetUserInfo 获取用户信息 - 实现 PanService 接口,cookie 参数为 refresh_token,先获取 access_token 再访问 API
|
||||
func (x *XunleiPanService) GetUserInfo(cookie string) (*UserInfo, error) {
|
||||
func (x *XunleiPanService) GetUserInfo(cookie *string) (*UserInfo, error) {
|
||||
log.Printf("开始获取迅雷网盘用户信息(cookie 为 refresh_token)")
|
||||
|
||||
// 使用 refresh_token 获取 access_token
|
||||
accessTokenData, err := x.GetAccessTokenByRefreshToken(cookie)
|
||||
accessTokenData, err := x.GetAccessTokenByRefreshToken(*cookie)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("获取 access_token 失败: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user