Skip to content

Commit

Permalink
fix(139): restore the Account handling, partially reverts #7850 (#7900
Browse files Browse the repository at this point in the history
 close #7784)
  • Loading branch information
abc1763613206 authored Jan 30, 2025
1 parent d53eecc commit b9f397d
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions drivers/139/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package _139

import (
"context"
"encoding/base64"
"fmt"
"io"
"net/http"
"path"
"strconv"
"strings"
"time"

"github.com/alist-org/alist/v3/drivers/base"
Expand Down Expand Up @@ -69,29 +71,28 @@ func (d *Yun139) Init(ctx context.Context) error {
default:
return errs.NotImplement
}
// if d.ref != nil {
// return nil
// }
// decode, err := base64.StdEncoding.DecodeString(d.Authorization)
// if err != nil {
// return err
// }
// decodeStr := string(decode)
// splits := strings.Split(decodeStr, ":")
// if len(splits) < 2 {
// return fmt.Errorf("authorization is invalid, splits < 2")
// }
// d.Account = splits[1]
// _, err = d.post("/orchestration/personalCloud/user/v1.0/qryUserExternInfo", base.Json{
// "qryUserExternInfoReq": base.Json{
// "commonAccountInfo": base.Json{
// "account": d.getAccount(),
// "accountType": 1,
// },
// },
// }, nil)
// return err
return nil
if d.ref != nil {
return nil
}
decode, err := base64.StdEncoding.DecodeString(d.Authorization)
if err != nil {
return err
}
decodeStr := string(decode)
splits := strings.Split(decodeStr, ":")
if len(splits) < 2 {
return fmt.Errorf("authorization is invalid, splits < 2")
}
d.Account = splits[1]
_, err = d.post("/orchestration/personalCloud/user/v1.0/qryUserExternInfo", base.Json{
"qryUserExternInfoReq": base.Json{
"commonAccountInfo": base.Json{
"account": d.getAccount(),
"accountType": 1,
},
},
}, nil)
return err
}

func (d *Yun139) InitReference(storage driver.Driver) error {
Expand Down

0 comments on commit b9f397d

Please sign in to comment.