mirror of
https://github.com/AlistGo/alist.git
synced 2025-06-06 18:44:32 +08:00
🐛 fix change name error
This commit is contained in:
@ -68,6 +68,10 @@ func DeleteAccount(id uint) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeleteAccountFromMap(name string) {
|
||||
delete(accountsMap, name)
|
||||
}
|
||||
|
||||
func AccountsCount() int {
|
||||
return len(accountsMap)
|
||||
}
|
||||
@ -86,6 +90,15 @@ func GetAccount(name string) (Account, bool) {
|
||||
return account, ok
|
||||
}
|
||||
|
||||
func GetAccountById(id uint) (*Account, error) {
|
||||
var account Account
|
||||
account.ID = id
|
||||
if err := conf.DB.First(&account).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &account, nil
|
||||
}
|
||||
|
||||
func GetAccountFiles() ([]*File, error) {
|
||||
files := make([]*File, 0)
|
||||
var accounts []Account
|
||||
|
Reference in New Issue
Block a user