mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-05 18:09:24 +08:00
225 lines
5.0 KiB
Markdown
225 lines
5.0 KiB
Markdown
|
#### 编译构建
|
|||
|
环境:
|
|||
|
cl.exe目录= c:/cl.exe
|
|||
|
ml64.exe目录 =c:/ml64.exe
|
|||
|
vcpkg目录 = c:/vcpkg
|
|||
|
wxhelper目录 = c:/wxhelper
|
|||
|
```
|
|||
|
|
|||
|
vcpkg install detours:x64-windows
|
|||
|
vcpkg install nlohmann-json:x64-windows
|
|||
|
|
|||
|
cd wxhelper
|
|||
|
mkdir build
|
|||
|
cd build
|
|||
|
cmake -DCMAKE_C_COMPILER=cl.exe \
|
|||
|
-DCMAKE_CXX_COMPILER=cl.exe \
|
|||
|
-DCMAKE_ASM_MASM_COMPILER=ml64.exe \
|
|||
|
-DCMAKE_BUILD_TYPE=Debug \
|
|||
|
-DCMAKE_INSTALL_PREFIX=C:/wxhelper/install/x64-debug \
|
|||
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
|||
|
-SC:c:/wxhelper \
|
|||
|
-BC:c:/wxhelper/build/x64-debug\
|
|||
|
-G Ninja
|
|||
|
cmake --build ..
|
|||
|
```
|
|||
|
如果有错误按错误提示修正即可。
|
|||
|
|
|||
|
## 3.9.5.81版本,http接口文档,文档仅供参考。
|
|||
|
|
|||
|
### 简单说明:
|
|||
|
所有接口只支持post方法。
|
|||
|
全部使用json格式。
|
|||
|
格式: http://host:port/api/xxxx
|
|||
|
host: 绑定的host
|
|||
|
port: 监听的端口
|
|||
|
xxxx: 对应的功能路径
|
|||
|
返回结构的json格式:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": {},
|
|||
|
"msg": "success"
|
|||
|
}
|
|||
|
```
|
|||
|
code: 错误码
|
|||
|
msg: 成功/错误信息
|
|||
|
data: 接口返回的数据
|
|||
|
|
|||
|
|
|||
|
#### 0.检查微信登录**
|
|||
|
###### 接口功能
|
|||
|
> 检查微信是否登录
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/checkLogin](/api/checkLogin)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,1 成功, 0失败|
|
|||
|
|result|string|成功提示|
|
|||
|
|data|string|响应内容|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"result": "ok"
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
#### 1.获取登录用户信息**
|
|||
|
###### 接口功能
|
|||
|
> 获取登录用户信息
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/userInfo](/api/userInfo)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,1 成功, 0失败|
|
|||
|
|result|string|成功提示|
|
|||
|
|data|object|响应内容|
|
|||
|
|account|string|账号|
|
|||
|
|headImage|string|头像|
|
|||
|
|city|string|城市|
|
|||
|
|country|string|国家|
|
|||
|
|currentDataPath|string|当前数据目录,登录的账号目录|
|
|||
|
|dataSavePath|string|微信保存目录|
|
|||
|
|mobile|string|手机|
|
|||
|
|name|string|昵称|
|
|||
|
|province|string|省|
|
|||
|
|wxid|string|wxid|
|
|||
|
|signature|string|个人签名|
|
|||
|
|dbKey|string|数据库的SQLCipher的加密key,可以使用该key配合decrypt.py解密数据库
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"code": 1,
|
|||
|
"data": {
|
|||
|
"account": "xxx",
|
|||
|
"city": "Zhengzhou",
|
|||
|
"country": "CN",
|
|||
|
"currentDataPath": "C:\\WeChat Files\\wxid_xxx\\",
|
|||
|
"dataSavePath": "C:\\wechatDir\\WeChat Files\\",
|
|||
|
"dbKey": "965715e30e474da09250cb5aa047e3940ffa1c8f767c4263b132bb512933db49",
|
|||
|
"headImage": "https://wx.qlogo.cn/mmhead/ver_1/MiblV0loY0GILewQ4u2121",
|
|||
|
"mobile": "13949175447",
|
|||
|
"name": "xxx",
|
|||
|
"province": "Henan",
|
|||
|
"signature": "xxx",
|
|||
|
"wxid": "wxid_22222"
|
|||
|
},
|
|||
|
"msg": "success"
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#### 2.发送文本消息**
|
|||
|
###### 接口功能
|
|||
|
> 发送文本消息
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/sendTextMsg](/api/sendTextMsg)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|wxid |true |string| 接收人wxid |
|
|||
|
|msg|true |string|消息文本内容|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,不为0成功, 0失败|
|
|||
|
|result|string|成功提示|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"wxid": "filehelper",
|
|||
|
"msg": "1112222"
|
|||
|
}
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{"code":345686720,"msg":"success","data":null}
|
|||
|
```
|
|||
|
|
|||
|
#### 3.hook消息**
|
|||
|
###### 接口功能
|
|||
|
> hook接收文本消息,图片消息,群消息.该接口将hook的消息通过tcp回传给本地的端口。
|
|||
|
enableHttp=1时,使用url,timeout参数配置服务端的接收地址。请求为post,Content-Type 为json。
|
|||
|
enableHttp=0时,使用ip,port的tcp服务回传消息。
|
|||
|
|
|||
|
###### 接口地址
|
|||
|
> [/api/hookSyncMsg](/api/hookSyncMsg)
|
|||
|
|
|||
|
###### HTTP请求方式
|
|||
|
> POST JSON
|
|||
|
|
|||
|
###### 请求参数
|
|||
|
|参数|必选|类型|说明|
|
|||
|
|---|---|---|---|
|
|||
|
|port |true |string| 本地服务端端口,用来接收消息内容 |
|
|||
|
|ip |true |string| 服务端ip地址,用来接收消息内容,可以是任意ip,即tcp客户端连接的服务端的ip|
|
|||
|
|url |true |string| http的请求地址,enableHttp=1时,不能为空 |
|
|||
|
|timeout |true |string| 超时时间,单位ms|
|
|||
|
|enableHttp |true |number| 0/1 :1.启用http 0.不启用http|
|
|||
|
|
|||
|
###### 返回字段
|
|||
|
|返回字段|字段类型|说明 |
|
|||
|
|---|---|---|
|
|||
|
|code|int|返回状态,1成功, 0失败|
|
|||
|
|result|string|成功提示|
|
|||
|
|
|||
|
|
|||
|
###### 接口示例
|
|||
|
入参:
|
|||
|
``` javascript
|
|||
|
{
|
|||
|
"port": "19099"
|
|||
|
"ip":"127.0.0.1",
|
|||
|
"url":"http://localhost:8080",
|
|||
|
"timeout":"3000",
|
|||
|
"enableHttp":"0"
|
|||
|
}
|
|||
|
```
|
|||
|
响应:
|
|||
|
``` javascript
|
|||
|
{"code":200,"msg":"success","data":null}
|
|||
|
```
|