mirror of https://github.com/Xhofe/alist
parent
cd5a8a011d
commit
c3c5181847
|
@ -9,8 +9,9 @@ type Addition struct {
|
|||
driver.RootPath
|
||||
|
||||
Address string `json:"address" required:"true"`
|
||||
UserName string `json:"username" required:"true"`
|
||||
Password string `json:"password" required:"true"`
|
||||
UserName string `json:"username" required:"false"`
|
||||
Password string `json:"password" required:"false"`
|
||||
Token string `json:"token" required:"false"`
|
||||
RepoId string `json:"repoId" required:"false"`
|
||||
RepoPwd string `json:"repoPwd" required:"false"`
|
||||
}
|
||||
|
|
|
@ -14,6 +14,10 @@ import (
|
|||
)
|
||||
|
||||
func (d *Seafile) getToken() error {
|
||||
if d.Token != "" {
|
||||
d.authorization = fmt.Sprintf("Token %s", d.Token)
|
||||
return nil
|
||||
}
|
||||
var authResp AuthTokenResp
|
||||
res, err := base.RestyClient.R().
|
||||
SetResult(&authResp).
|
||||
|
|
Loading…
Reference in New Issue