fix(139): restore the Account handling, partially reverts #7850 (#7900 close #7784)

This commit is contained in:
abc1763613206 2025-01-30 11:25:41 +08:00 committed by GitHub
parent d53eecc229
commit b9f397d29f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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