# 微信开放平台接口 ## 接口标准 - HTTP 入口:`/api/wechat-service/{controller}/{action}` - `push/*` 为微信开放平台回调接口,既可能返回纯文本,也可能返回重定向或 HTML - `client/*` 为远程服务接口,调用前需要准备签名 `token` ## 接口列表 ### `/api/wechat-service/push/notify` - 说明:处理开放平台推送事件 ```jsonc { "appid": "wx1234567890" // 可选,测试号或指定授权方 appid } ``` ### `/api/wechat-service/push/ticket` - 说明:处理 component ticket、取消授权和授权更新事件 ```jsonc {} ``` ### `/api/wechat-service/push/oauth` - 说明:代授权网页 OAuth 回调处理 ```jsonc { "mode": 1, // 授权模式,0 静默,1 完整 "state": "wx1234567890", // 授权方 appid "enurl": "BASE64_URL", // 加密后的回跳地址 "oauthid": "oauth-session-id" // OAuth 会话编号 } ``` ### `/api/wechat-service/push/auth` - 说明:跳转到开放平台授权页面,或处理授权完成回跳 ```jsonc { "source": "BASE64_URL", // 必填,加密后的回跳地址 "auth_code": "" // 可选,微信授权完成后的授权码 } ``` ### `/api/wechat-service/client/yar` - 说明:通过 YAR 协议调用远程服务实例 ```jsonc { "token": "BASE64_URL_TOKEN" // 远程服务访问令牌,包含类名、appid、时间戳和签名 } ``` ### `/api/wechat-service/client/soap` - 说明:通过 SOAP 协议调用远程服务实例 ```jsonc { "token": "BASE64_URL_TOKEN" // 远程服务访问令牌 } ``` ### `/api/wechat-service/client/jsonrpc` - 说明:通过 JSON-RPC 调用远程服务实例 ```jsonc { "token": "BASE64_URL_TOKEN" // 远程服务访问令牌 } ```