Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/icepie/oh-my-lit
Browse files Browse the repository at this point in the history
  • Loading branch information
icepie committed Aug 5, 2021
2 parents e436b93 + 3b78b71 commit 67cb96c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions example/zhyd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"log"
"net/url"
"os"

"github.com/icepie/oh-my-lit/client/zhyd"
Expand All @@ -14,10 +15,11 @@ func main() {

log.Println("智慧控电测试")

zhydUser, err := zhyd.NewZhydUser("B19071121", "")
if err != nil {
log.Println("实例化用户失败: ", err)
}
zhydUser := zhyd.NewZhydUser().
SetUsename("B19071121").
SetPassword("")

//zhydUser.Client.SetDebug(true)

b, err := zhydUser.IsNeedCaptcha()
if err != nil {
Expand Down Expand Up @@ -59,7 +61,7 @@ func main() {
log.Fatal("登陆失败: ", err)
}

isLogged, err := zhydUser.IsLogged()
isLogged := zhydUser.IsLogged()
if isLogged {
de, err := zhydUser.GetDormElectricity()
if err != nil {
Expand All @@ -83,7 +85,6 @@ func main() {
log.Println(cr)

} else {
log.Println("似乎未登陆: ", err)
log.Println("似乎未登陆!")
}

}

1 comment on commit 67cb96c

@vercel
Copy link

@vercel vercel bot commented on 67cb96c Aug 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.