Skip to content

Commit

Permalink
fix(login): ensure being in the dhcp table before login (#49)
Browse files Browse the repository at this point in the history
closes #48
  • Loading branch information
bsbds committed May 29, 2022
1 parent 160d5db commit 69899c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/handler/ipgw.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ func (h *IpgwHandler) Login(account *model.Account) error {
password string
body string
err error
resp *http.Response
)

// 修复首次登录失败问题
resp, err = h.client.Get("http://198.18.0.1")
if err != nil {
return err
}
defer resp.Body.Close()

if account.Cookie != "" {
body, err = h.loginCookie(account.Cookie) // 通过cookie登录
} else {
Expand Down

0 comments on commit 69899c0

Please sign in to comment.