Skip to content

Commit 3e3776d

Browse files
authored
Merge pull request #9567 from UcnacDx2/refactor-139-driver-optimized-upstream-20260626
feat(drivers/139): optimize login credential flow
2 parents cdeed27 + 1d6e22f commit 3e3776d

4 files changed

Lines changed: 951 additions & 11 deletions

File tree

drivers/139/driver.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ func (d *Yun139) GetAddition() driver.Additional {
4040

4141
func (d *Yun139) Init(ctx context.Context) error {
4242
if d.ref == nil {
43-
if len(d.Authorization) == 0 {
44-
return fmt.Errorf("authorization is empty")
43+
if err := d.validateAndInitCredentials(); err != nil {
44+
return err
4545
}
46+
4647
err := d.refreshToken()
4748
if err != nil {
4849
return err

drivers/139/meta.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ import (
66
)
77

88
type Addition struct {
9-
Authorization string `json:"authorization" type:"text" required:"true"`
9+
Authorization string `json:"authorization" type:"text" help:"Authorization can be used alone. If empty, use mail_cookies alone for fast login, or mail_cookies + username + password for full login fallback."`
10+
Username string `json:"username" help:"Required only when using password login fallback with mail_cookies."`
11+
Password string `json:"password" secret:"true" help:"Required only when using password login fallback with mail_cookies."`
12+
MailCookies string `json:"mail_cookies" type:"text" help:"Cookies from mail.10086.cn. Can be used alone for fast login, or with username and password for full login fallback."`
1013
driver.RootID
1114
Type string `json:"type" type:"select" options:"personal_new,family,group,personal,share" default:"personal_new"`
1215
CloudID string `json:"cloud_id"`
1316
LinkID string `json:"link_id"`
17+
UserDomainID string `json:"user_domain_id" help:"ud_id in Cookie, fill in to show disk usage"`
1418
CustomUploadPartSize int64 `json:"custom_upload_part_size" type:"number" default:"0"`
1519
ReportRealSize bool `json:"report_real_size" type:"bool" default:"true"`
1620
UseLargeThumbnail bool `json:"use_large_thumbnail" type:"bool" default:"false"`

0 commit comments

Comments
 (0)