perf(123): reduce login count

This commit is contained in:
Andy Hsu 2023-04-03 11:24:29 +08:00
parent 3cdb8e7a81
commit 0acba7cd22
2 changed files with 7 additions and 8 deletions

View File

@ -29,7 +29,6 @@ import (
type Pan123 struct {
model.Storage
Addition
AccessToken string
}
func (d *Pan123) Config() driver.Config {
@ -41,7 +40,8 @@ func (d *Pan123) GetAddition() driver.Additional {
}
func (d *Pan123) Init(ctx context.Context) error {
return d.login()
_, err := d.request("https://www.123pan.com/b/api/user/info", http.MethodGet, nil, nil)
return err
}
func (d *Pan123) Drop(ctx context.Context) error {

View File

@ -6,14 +6,13 @@ import (
)
type Addition struct {
Username string `json:"username" required:"true"`
Password string `json:"password" required:"true"`
Username string `json:"username" required:"true"`
Password string `json:"password" required:"true"`
driver.RootID
OrderBy string `json:"order_by" type:"select" options:"file_name,size,update_at" default:"file_name"`
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
driver.RootID
// define other
StreamUpload bool `json:"stream_upload"`
//Field string `json:"field" type:"select" required:"true" options:"a,b,c" default:"a"`
StreamUpload bool `json:"stream_upload"`
AccessToken string
}
var config = driver.Config{