支持通过scheme跳转强国app,同时可自定义scheme
This commit is contained in:
parent
ab9c181c87
commit
f0744edbe8
|
@ -12,6 +12,7 @@ type Config struct {
|
|||
Model int `json:"model" yaml:"model"`
|
||||
LogLevel string `json:"log_level" yaml:"log_level"`
|
||||
ShowBrowser bool `json:"show_browser" yaml:"show_browser"`
|
||||
Scheme string `json:"scheme" yaml:"scheme"`
|
||||
Push struct {
|
||||
Ding struct {
|
||||
Enable bool `json:"enable" yaml:"enable"`
|
||||
|
|
|
@ -17,6 +17,9 @@ log_level: "info"
|
|||
# 是否显示浏览器
|
||||
show_browser: true
|
||||
|
||||
# 跳转学习强国的scheme,默认使用本仓库的action自建scheme,若需自行修改,可直接复制仓库下/docs/scheme.html到任意静态文件服务器
|
||||
scheme: "https://johlanse.github.io/study_xxqg/scheme.html?"
|
||||
|
||||
|
||||
push:
|
||||
ding:
|
||||
|
|
|
@ -171,18 +171,14 @@ func (c *Core) Login() ([]Cookie, error) {
|
|||
|
||||
var result []byte
|
||||
buffer := bytes.NewBuffer(result)
|
||||
//os.WriteFile("screen1.png", screen, 0666)
|
||||
//_ = Clip(bytes.NewReader(screen), buffer, 0, 0, 525, 35, 755, 255, 0)
|
||||
_ = Clip(bytes.NewReader(screen), buffer, 0, 0, 529, 70, 748, 284, 0)
|
||||
|
||||
c.Push("markdown", fmt.Sprintf(" \n>点开查看登录二维码\n>请在五分钟内完成扫码", "data:image/png;base64,"+base64.StdEncoding.EncodeToString(buffer.Bytes())))
|
||||
c.Push("image", base64.StdEncoding.EncodeToString(buffer.Bytes()))
|
||||
//os.WriteFile("screen.png", buffer.Bytes(), 0666)
|
||||
matrix := GetPaymentStr(bytes.NewReader(buffer.Bytes()))
|
||||
log.Debugln("已获取到二维码内容:" + matrix.GetText())
|
||||
|
||||
c.Push("text", "https://techxuexi.js.org/jump/techxuexi-20211023.html?"+url.QueryEscape(matrix.GetText()))
|
||||
c.Push("text", matrix.GetText())
|
||||
c.Push("text", GetConfig().Scheme+url.QueryEscape(matrix.GetText()))
|
||||
|
||||
qrcodeTerminal.New2(qrcodeTerminal.ConsoleColors.BrightBlack, qrcodeTerminal.ConsoleColors.BrightWhite, qrcodeTerminal.QRCodeRecoveryLevels.Low).Get(matrix.GetText()).Print()
|
||||
_, err = page.WaitForNavigation(playwright.PageWaitForNavigationOptions{
|
||||
|
|
Loading…
Reference in New Issue