Compare commits

...

5 Commits

Author SHA1 Message Date
Tuzki 3bd02a1a93 build:配置环境变量并禁用平台检查 7 months ago
chunbo007 aaf6097daf
Update README.md 8 months ago
李春波 7db152a4d6 调整记录日志的格式 8 months ago
李春波 f6b7b9eb2e 修复BUG 1 year ago
李春波 aa3a7f2fec 修复不记录消息与事件通知的问题 1 year ago
  1. 6
      .env copy.example
  2. 10
      README.md
  3. 17
      app/common/service/wechat/OpenPlatform.php
  4. 3
      composer.json
  5. 2
      front/src/views/message/modules/authorizer.vue
  6. 6
      front/src/views/message/modules/event.vue
  7. 8188
      front/yarn.lock

@ -3,9 +3,9 @@ APP_DEBUG = true
# mysql
DB_HOST = 127.0.0.1
DB_PORT = 3306
DB_NAME =
DB_USER =
DB_PASSWORD =
DB_NAME = mp_company
DB_USER = root
DB_PASSWORD = 12580110
# 网站外网域名 例如 https://www.example.com
SITE_URL = ''

@ -1,3 +1,11 @@
# 广告
开发了一款SaaS化的中台,[云管家](https://www.isvapi.com)[https://www.isvapi.com](https://www.isvapi.com),不想自己花时间搭建二开的朋友也可以直接去看看这个,当前这个开源项目仍然可以正常使用,功能不受影响
# 在线交流
| 个人微信 | 微信群 |
| :---: | :---: |
| <img src="http://img.isvapi.com/www/images/wechat/wechat-qrcode.jpg" alt="个人微信" width=260>| <img src="https://img.isvapi.com/www/images/wechat/wechat-group.jpg" alt="微信群" width=260> |
# wechat-mp 项目简介
微信开放平台管理工具
微信开放平台服务商一般有多套小程序需要管理,帮人代开发时需要客户不停扫码授权,体验极其不好。对于SAAS小程序服务商也可以在运维平台中尝试二开对接开放平台的api,但是项目多了以后每个运营平台都需要重复造轮子,而且维护成本也高,所以萌生了写一个通用管理微信开放平台的工具。
@ -19,7 +27,6 @@
2. 前端 [ant-design-vue-pro](https://pro.antdv.com/docs/getting-started)
3. SDK [EasyWechat](https://easywechat.com)
# 本地搭建视频教程
[wechat-mp 微信开放平台小程序管理工具本地部署教程](https://www.bilibili.com/video/BV1M7421f7Ff)
@ -40,6 +47,7 @@
# 安装步骤
1. 下载代码
```
// github
git clone https://github.com/chunbo007/wechat-mp.git

@ -18,7 +18,7 @@ use Tinywan\ExceptionHandler\Exception\BadRequestHttpException;
class OpenPlatform extends BaseServices {
public Application $app;
private int $platform_id;
private $platform_id;
/**
* @throws DataNotFoundException
@ -69,7 +69,8 @@ class OpenPlatform extends BaseServices {
$symfony_request = new SymfonyRequest($request->get(), $request->post(), [], $request->cookie(), [], [], $request->rawBody());
$symfony_request->headers = new HeaderBag($request->header());
$this->app->rebind('request', $symfony_request);
$this->app->server->push(function ($message) use ($appid) {
// 授权事件
$this->app->server->push(function ($message) {
if (isset($message['InfoType'])) {
// 授权事件 日志记录
$this->addComponentCallBackRecord($message);
@ -84,11 +85,13 @@ class OpenPlatform extends BaseServices {
default:
break;
}
} else if (isset($message['MsgType'])) {
// 消息与事件通知 日志记录
$this->addWxcallbackBizRecord($message, $appid);
}
});
// 消息与事件通知 日志记录
$message = $this->app->server->getMessage();
if (isset($message['Event'])) {
$this->addWxcallbackBizRecord($message, $appid);
}
$response = $this->app->server->serve();
return $response->getContent();
@ -206,7 +209,7 @@ class OpenPlatform extends BaseServices {
'appid' => $data['AppId'],
'authorizer_appid' => $data['AuthorizerAppid'] ?? null,
'infotype' => $data['InfoType'],
'postbody' => json_encode($data),
'postbody' => json_encode($data, JSON_UNESCAPED_UNICODE),
'receivetime' => $data['CreateTime']
];
WxcallbackComponent::create($row);
@ -219,7 +222,7 @@ class OpenPlatform extends BaseServices {
'tousername' => $data['ToUserName'],
'msgtype' => $data['MsgType'],
'event' => $data['Event'],
'postbody' => json_encode($data),
'postbody' => json_encode($data, JSON_UNESCAPED_UNICODE),
'receivetime' => $data['CreateTime']
];
WxcallbackBiz::create($row);

@ -65,6 +65,7 @@
"config": {
"allow-plugins": {
"easywechat-composer/easywechat-composer": true
}
},
"platform-check": false
}
}

@ -78,7 +78,7 @@ const columns = [
width: 180
},
{
title: 'appid',
title: 'component_appid',
dataIndex: 'appid',
width: 180
},

@ -76,13 +76,13 @@ const columns = [
width: 180
},
{
title: 'appid',
title: 'authorizer_appid',
dataIndex: 'appid',
width: 180
},
{
title: 'MsgType',
dataIndex: 'msgtype',
title: 'event',
dataIndex: 'event',
width: 220
},
{

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save