mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 13:54:04 +08:00
🐛 fix no account error while only one
This commit is contained in:
parent
6827af3997
commit
0814778a14
@ -107,6 +107,11 @@ func GetAccount(name string) (Account, bool) {
|
||||
|
||||
func GetAccountsByName(name string) []Account {
|
||||
accounts := make([]Account, 0)
|
||||
if AccountsCount() == 1 {
|
||||
account, _ := GetAccount("")
|
||||
accounts = append(accounts, account)
|
||||
return accounts
|
||||
}
|
||||
for _, v := range accountsMap {
|
||||
if v.Name == name || v.Name == name+balance {
|
||||
accounts = append(accounts, v)
|
||||
|
Loading…
x
Reference in New Issue
Block a user