mqtt加入认证,优化视频播放与浏览器

This commit is contained in:
2025-03-07 16:04:19 +08:00
parent c71e8bc13d
commit febcdfdbf7
13 changed files with 60 additions and 82 deletions

View File

@@ -5,8 +5,6 @@ import (
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/launcher"
"github.com/go-rod/rod/lib/launcher/flags"
"github.com/go-rod/rod/lib/proto"
"go.uber.org/zap"
)
// OpenApp 用APP模式打开网页
@@ -26,18 +24,5 @@ func OpenApp(c context.Context, url string) {
b := rod.New().ControlURL(p).MustConnect()
defer b.MustClose()
s := make(chan struct{})
wait := b.EachEvent(func(e *proto.TargetTargetDestroyed) {
zap.S().Infoln("浏览器关闭事件")
s <- struct{}{}
})
go wait()
select {
case <-c.Done():
b.MustClose()
<-s
case <-s:
}
<-c.Done()
}