|
|
|
|
@ -23,7 +23,7 @@ func (b *BilibiliVendor) BeforeSave(tx *gorm.DB) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *BilibiliVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
func (b *BilibiliVendor) AfterSave(tx *gorm.DB) error {
|
|
|
|
|
key := []byte(b.UserID)
|
|
|
|
|
for k, v := range b.Cookies {
|
|
|
|
|
value, err := utils.DecryptoFromBase64(v, key)
|
|
|
|
|
@ -35,6 +35,10 @@ func (b *BilibiliVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *BilibiliVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
return b.AfterSave(tx)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AlistVendor struct {
|
|
|
|
|
UserID string `gorm:"primaryKey"`
|
|
|
|
|
Backend string
|
|
|
|
|
@ -58,7 +62,7 @@ func (a *AlistVendor) BeforeSave(tx *gorm.DB) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *AlistVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
func (a *AlistVendor) AfterSave(tx *gorm.DB) error {
|
|
|
|
|
key := []byte(a.UserID)
|
|
|
|
|
if v, err := utils.DecryptoFromBase64(a.Host, key); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
@ -78,6 +82,10 @@ func (a *AlistVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *AlistVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
return a.AfterSave(tx)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type EmbyVendor struct {
|
|
|
|
|
UserID string `gorm:"primaryKey"`
|
|
|
|
|
Backend string
|
|
|
|
|
@ -105,7 +113,7 @@ func (e *EmbyVendor) BeforeSave(tx *gorm.DB) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (e *EmbyVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
func (e *EmbyVendor) AfterSave(tx *gorm.DB) error {
|
|
|
|
|
key := []byte(e.UserID)
|
|
|
|
|
if v, err := utils.DecryptoFromBase64(e.Host, key); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
@ -129,3 +137,7 @@ func (e *EmbyVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (e *EmbyVendor) AfterFind(tx *gorm.DB) error {
|
|
|
|
|
return e.AfterSave(tx)
|
|
|
|
|
}
|
|
|
|
|
|