mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-26 17:28:48 +08:00
parent
23a1fbdd4b
commit
4e2f24a8f0
5 changed files with 21 additions and 2 deletions
|
|
@ -393,7 +393,6 @@ func RefreshGoogleToken(grantType string, tokenType string, varMap map[string]in
|
|||
if err := json.Unmarshal(resp.Body(), &respItem); err != nil {
|
||||
return "", err
|
||||
}
|
||||
fmt.Println(respItem)
|
||||
if tokenType == "accessToken" {
|
||||
return respItem.AccessToken, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ func NewCloudStorageClient(backupType string, vars map[string]interface{}) (Clou
|
|||
return client.NewUpClient(vars)
|
||||
case constant.ALIYUN:
|
||||
return client.NewALIClient(vars)
|
||||
case constant.GoogleDrive:
|
||||
return client.NewGoogleDriveClient(vars)
|
||||
default:
|
||||
return nil, buserr.WithName("ErrNotSupportType", backupType)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const (
|
|||
GoogleDrive = "GoogleDrive"
|
||||
|
||||
OneDriveRedirectURI = "http://localhost/login/authorized"
|
||||
GoogleRedirectURI = "http://localhost:8080"
|
||||
GoogleRedirectURI = "https://localhost:8080"
|
||||
|
||||
DaemonJsonPath = "/etc/docker/daemon.json"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ func Init() {
|
|||
migrations.InitGoogle,
|
||||
migrations.AddTaskDB,
|
||||
migrations.AddXpackHideMenu,
|
||||
migrations.UpdateGoogle,
|
||||
migrations.UpdateXpackHideMenu,
|
||||
})
|
||||
if err := m.Migrate(); err != nil {
|
||||
|
|
|
|||
|
|
@ -440,3 +440,20 @@ var UpdateXpackHideMenu = &gormigrate.Migration{
|
|||
return tx.Model(&model.Setting{}).Where("key = ?", "HideMenu").Update("value", string(updatedJSON)).Error
|
||||
},
|
||||
}
|
||||
|
||||
var UpdateGoogle = &gormigrate.Migration{
|
||||
ID: "20250616-update-google",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
if err := tx.Model(&model.Setting{}).
|
||||
Where("key = ?", "GoogleID").
|
||||
Update("value", "NTU2NTQ3NDYwMTQtY2Q0bGR0dDk2aGNsNWcxYWtwdmJhZTFmcjJlZ2Y0MXAuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20=").Error; err != nil {
|
||||
return err
|
||||
}
|
||||
if err := tx.Model(&model.Setting{}).
|
||||
Where("key = ?", "GoogleSc").
|
||||
Update("value", "R09DU1BYLXRibXg0QVdVZ3d3Ykc2QW1XTHQ3YUdaZElVeE4=").Error; err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue