From f0bb46b9ab3ad5dd64d7e87d2279b80279301ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Tue, 9 Jan 2024 10:48:21 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20=E6=96=B0=E5=A2=9E=E6=98=BE=E7=A4=BAvnc?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index.go | 2 ++ config.yaml | 2 ++ config/wechat.go | 1 + docker-compose.yaml | 4 ++-- readme.md | 6 ++++-- views/index.html | 9 +++++++++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/index.go b/app/index.go index ce5a8796..49a4a626 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 61f9ff25..da6237f2 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 7e6ec347..9380a6bd 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 92a04bf3..5cd19ecb 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 8c4aea31..2dc4f34a 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 72bd538e..5c40b6ec 100644 --- a/views/index.html +++ b/views/index.html @@ -151,6 +151,15 @@ + + {{ if ne .vnc "" }} + +
+
+ +
+
+ {{ end }}