1 Star 0 Fork 0

thinkcore / wailslong2024

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"changeme/businessLogic/mqtt"
"context" // 这里添加 context 包的导入
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
// Create an instance of the app structure
app := NewApp()
// Create application with options
err := wails.Run(&options.App{
Title: "闸控上位机",
Width: 1524,
Height: 768,
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
//OnStartup: app.startup,
OnStartup: func(ctx context.Context) {
app.startup(ctx)
mqtt.InitMQTTClient() // 初始化 MQTT 客户端
},
Bind: []interface{}{
app,
},
})
if err != nil {
println("Error:", err.Error())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/thinkcore/wailslong2024.git
git@gitee.com:thinkcore/wailslong2024.git
thinkcore
wailslong2024
wailslong2024
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891