init code
This commit is contained in:
parent
412120689c
commit
8fe277be6f
|
@ -14,9 +14,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Core struct {
|
type Core struct {
|
||||||
pw *playwright.Playwright
|
pw *playwright.Playwright
|
||||||
browser playwright.Browser
|
browser playwright.Browser
|
||||||
context playwright.BrowserContext
|
context playwright.BrowserContext
|
||||||
|
ShowBrowser bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type cookie struct {
|
type cookie struct {
|
||||||
|
@ -62,7 +63,7 @@ func (c *Core) Init() {
|
||||||
HandleSIGHUP: nil,
|
HandleSIGHUP: nil,
|
||||||
HandleSIGINT: nil,
|
HandleSIGINT: nil,
|
||||||
HandleSIGTERM: nil,
|
HandleSIGTERM: nil,
|
||||||
Headless: playwright.Bool(false),
|
Headless: playwright.Bool(c.ShowBrowser),
|
||||||
Proxy: nil,
|
Proxy: nil,
|
||||||
SlowMo: nil,
|
SlowMo: nil,
|
||||||
Timeout: nil,
|
Timeout: nil,
|
||||||
|
|
2
main.go
2
main.go
|
@ -48,7 +48,7 @@ func main() {
|
||||||
2:只刷文章和视频和每日答题
|
2:只刷文章和视频和每日答题
|
||||||
3:刷文章和视频和每日答题每周答题和专项答题`)
|
3:刷文章和视频和每日答题每周答题和专项答题`)
|
||||||
log.Infoln("检测到模式", config.Model)
|
log.Infoln("检测到模式", config.Model)
|
||||||
core := lib.Core{}
|
core := lib.Core{ShowBrowser: config.ShowBrowser}
|
||||||
defer core.Quit()
|
defer core.Quit()
|
||||||
core.Init()
|
core.Init()
|
||||||
login, err := core.Login()
|
login, err := core.Login()
|
||||||
|
|
Loading…
Reference in New Issue