面板无设备数列表接口时暂不报错

This commit is contained in:
wyx2685 2024-09-01 05:27:11 +09:00
parent 12fbcb1460
commit ea0b7d8f40
No known key found for this signature in database
GPG Key ID: 8827A30FF1DB1379

View File

@ -54,14 +54,14 @@ func (c *Client) GetUserList() ([]UserInfo, error) {
return c.UserList.Users, nil return c.UserList.Users, nil
} }
// GetUserAlive will fetch the alive IPs for users // GetUserAlive will fetch the alive_ip count for users
func (c *Client) GetUserAlive() (map[int]int, error) { func (c *Client) GetUserAlive() (map[int]int, error) {
const path = "/api/v1/server/UniProxy/alivelist" const path = "/api/v1/server/UniProxy/alivelist"
r, err := c.client.R(). r, err := c.client.R().
ForceContentType("application/json"). ForceContentType("application/json").
Get(path) Get(path)
if err = c.checkResponse(r, path, err); err != nil { if err != nil {
return nil, err return make(map[int]int), nil
} }
if r != nil { if r != nil {