🎨 change internal type
This commit is contained in:
parent
bd7d27efc7
commit
92a0453e00
@ -22,7 +22,7 @@ func (driver Lanzou) Config() base.DriverConfig {
|
|||||||
func (driver Lanzou) Items() []base.Item {
|
func (driver Lanzou) Items() []base.Item {
|
||||||
return []base.Item{
|
return []base.Item{
|
||||||
{
|
{
|
||||||
Name: "onedrive_type",
|
Name: "internal_type",
|
||||||
Label: "lanzou type",
|
Label: "lanzou type",
|
||||||
Type: base.TypeSelect,
|
Type: base.TypeSelect,
|
||||||
Required: true,
|
Required: true,
|
||||||
@ -53,7 +53,7 @@ func (driver Lanzou) Items() []base.Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (driver Lanzou) Save(account *model.Account, old *model.Account) error {
|
func (driver Lanzou) Save(account *model.Account, old *model.Account) error {
|
||||||
if account.OnedriveType == "cookie" {
|
if account.InternalType == "cookie" {
|
||||||
if account.RootFolder == "" {
|
if account.RootFolder == "" {
|
||||||
account.RootFolder = "-1"
|
account.RootFolder = "-1"
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ func (driver Lanzou) Link(path string, account *model.Account) (*base.Link, erro
|
|||||||
}
|
}
|
||||||
log.Debugf("down file: %+v", file)
|
log.Debugf("down file: %+v", file)
|
||||||
downId := file.Id
|
downId := file.Id
|
||||||
if account.OnedriveType == "cookie" {
|
if account.InternalType == "cookie" {
|
||||||
downId, err = driver.GetDownPageId(file.Id, account)
|
downId, err = driver.GetDownPageId(file.Id, account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -53,7 +53,7 @@ type LanZouFilesResp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (driver *Lanzou) GetFiles(folderId string, account *model.Account) ([]LanZouFile, error) {
|
func (driver *Lanzou) GetFiles(folderId string, account *model.Account) ([]LanZouFile, error) {
|
||||||
if account.OnedriveType == "cookie" {
|
if account.InternalType == "cookie" {
|
||||||
files := make([]LanZouFile, 0)
|
files := make([]LanZouFile, 0)
|
||||||
var resp LanZouFilesResp
|
var resp LanZouFilesResp
|
||||||
// folders
|
// folders
|
||||||
|
@ -33,7 +33,7 @@ func (driver Onedrive) Items() []base.Item {
|
|||||||
Description: "",
|
Description: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "onedrive_type",
|
Name: "internal_type",
|
||||||
Label: "onedrive type",
|
Label: "onedrive type",
|
||||||
Type: base.TypeSelect,
|
Type: base.TypeSelect,
|
||||||
Required: true,
|
Required: true,
|
||||||
|
@ -46,7 +46,7 @@ func (driver Onedrive) GetMetaUrl(account *model.Account, auth bool, path string
|
|||||||
if auth {
|
if auth {
|
||||||
return host.Oauth
|
return host.Oauth
|
||||||
}
|
}
|
||||||
switch account.OnedriveType {
|
switch account.InternalType {
|
||||||
case "onedrive":
|
case "onedrive":
|
||||||
{
|
{
|
||||||
if path == "/" || path == "\\" {
|
if path == "/" || path == "\\" {
|
||||||
|
@ -30,7 +30,7 @@ type Account struct {
|
|||||||
RedirectUri string `json:"redirect_uri"`
|
RedirectUri string `json:"redirect_uri"`
|
||||||
SiteUrl string `json:"site_url"`
|
SiteUrl string `json:"site_url"`
|
||||||
SiteId string `json:"site_id"`
|
SiteId string `json:"site_id"`
|
||||||
OnedriveType string `json:"onedrive_type"`
|
InternalType string `json:"internal_type"`
|
||||||
WebdavProxy bool `json:"webdav_proxy"`
|
WebdavProxy bool `json:"webdav_proxy"`
|
||||||
Proxy bool `json:"proxy"` // 是否中转
|
Proxy bool `json:"proxy"` // 是否中转
|
||||||
//AllowProxy bool `json:"allow_proxy"` // 是否允许中转下载
|
//AllowProxy bool `json:"allow_proxy"` // 是否允许中转下载
|
||||||
|
Loading…
x
Reference in New Issue
Block a user