diff --git a/app/index.go b/app/index.go index ce5a879..49a4a62 100644 --- a/app/index.go +++ b/app/index.go @@ -3,6 +3,7 @@ package app import ( "fmt" "github.com/gin-gonic/gin" + "go-wechat/config" "go-wechat/service" "net/http" ) @@ -21,6 +22,7 @@ func Index(ctx *gin.Context) { } result["friends"] = friends result["groups"] = groups + result["vnc"] = config.Conf.Wechat.VncUrl // 渲染页面 ctx.HTML(http.StatusOK, "index.html", result) } diff --git a/config.yaml b/config.yaml index 61f9ff2..da6237f 100644 --- a/config.yaml +++ b/config.yaml @@ -2,6 +2,8 @@ wechat: # 微信HOOK接口地址 host: 10.0.0.73:19088 + # 微信容器映射出来的vnc页面地址,没有就不填 + vncUrl: http://192.168.1.175:19087/vnc_lite.html # 是否在启动的时候自动设置hook服务的回调 autoSetCallback: false # 回调IP,如果是Docker运行,本参数必填(填auto表示自动,不适用于 docker 环境),如果Docker修改了映射,格式为 ip:port diff --git a/config/wechat.go b/config/wechat.go index 7e6ec34..9380a6b 100644 --- a/config/wechat.go +++ b/config/wechat.go @@ -6,6 +6,7 @@ import "strings" // @description: 微信助手 type wechat struct { Host string `json:"host" yaml:"host"` // 接口地址 + VncUrl string `json:"vncUrl" yaml:"vncUrl"` // vnc页面地址 AutoSetCallback bool `json:"autoSetCallback" yaml:"autoSetCallback"` // 是否自动设置回调地址 Callback string `json:"callback" yaml:"callback"` // 回调地址 Forward []string `json:"forward" yaml:"forward"` // 转发地址 diff --git a/docker-compose.yaml b/docker-compose.yaml index 92a04bf..5cd19ec 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: '3.9' services: wechat: - image: lxh01/wxhelper-docker:3.9.5.81 + image: lxh01/wxhelper-docker:3.9.5.81-v11 container_name: gw-wechat restart: unless-stopped environment: @@ -10,7 +10,7 @@ services: volumes: - ./data/wechat:/home/app/.wine/drive_c/users/app/Documents/WeChat\ Files ports: - - "8080:8080" + - "19087:8080" - "19088:19088" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:19088/api/checkLogin"] diff --git a/readme.md b/readme.md index 8c4aea3..2dc4f34 100644 --- a/readme.md +++ b/readme.md @@ -14,6 +14,8 @@ vim config.yaml # 编辑配置文件,内容如下,最新配置请参考项 wechat: # 微信HOOK接口地址 host: wechat:19088 + # 微信容器映射出来的vnc页面地址,没有就不填 + vncUrl: http://192.168.1.175:19087/vnc_lite.html # 是否在启动的时候自动设置hook服务的回调 autoSetCallback: true # 回调IP,如果是Docker运行,本参数必填,如果Docker修改了映射,格式为 ip:port,如果使用项目提供的docker-compsoe.yaml文件启动,可以填`auto` @@ -46,7 +48,7 @@ version: '3.9' services: wechat: - image: lxh01/wxhelper-docker:3.9.5.81 + image: lxh01/wxhelper-docker:3.9.5.81-v11 container_name: gw-wechat restart: unless-stopped environment: @@ -54,7 +56,7 @@ services: volumes: - ./data/wechat:/home/app/.wine/drive_c/users/app/Documents/WeChat\ Files ports: - - "8080:8080" + - "19087:8080" - "19088:19088" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:19088/api/checkLogin"] diff --git a/views/index.html b/views/index.html index 72bd538..5c40b6e 100644 --- a/views/index.html +++ b/views/index.html @@ -151,6 +151,15 @@ + + {{ if ne .vnc "" }} + +
+
+ +
+
+ {{ end }}