{"id":13487600,"url":"https://github.com/unclexiao/egg-mp","last_synced_at":"2025-03-27T22:31:49.710Z","repository":{"id":34251676,"uuid":"173903475","full_name":"unclexiao/egg-mp","owner":"unclexiao","description":"EggJS插件：微信公众平台基本服务","archived":false,"fork":false,"pushed_at":"2023-04-20T21:28:58.000Z","size":1751,"stargazers_count":201,"open_issues_count":25,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-17T20:14:54.714Z","etag":null,"topics":["egg-plugin","eggjs","wechat"],"latest_commit_sha":null,"homepage":"https://mp.weixin.qq.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unclexiao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-05T08:12:32.000Z","updated_at":"2024-04-25T03:44:00.000Z","dependencies_parsed_at":"2024-01-16T09:05:44.995Z","dependency_job_id":"77b8fcba-fa4c-4f6a-a1e5-7b384d30510c","html_url":"https://github.com/unclexiao/egg-mp","commit_stats":{"total_commits":38,"total_committers":5,"mean_commits":7.6,"dds":0.5,"last_synced_commit":"1e9b499ce7988bcf6a4e3ec9b9a854cc0ce57033"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclexiao%2Fegg-mp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclexiao%2Fegg-mp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclexiao%2Fegg-mp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclexiao%2Fegg-mp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unclexiao","download_url":"https://codeload.github.com/unclexiao/egg-mp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222322034,"owners_count":16966433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egg-plugin","eggjs","wechat"],"created_at":"2024-07-31T18:01:01.065Z","updated_at":"2025-03-27T22:31:49.685Z","avatar_url":"https://github.com/unclexiao.png","language":"JavaScript","readme":"# egg-mp\n\n[![npm version](https://badge.fury.io/js/egg-mp.svg)](https://badge.fury.io/js/egg-mp)\n\n[微信公众平台](https://mp.weixin.qq.com/)常规的后端服务，献给了不起的[EggJS](https://eggjs.org/zh-cn/)\n\n## 特性\n### 微信小程序\n- [X] 小程序登录\n- [X] 小程序授权\n- [X] 小程序支付\n- [X] 推送模板消息\n- [X] 检测是否含有敏感词\n- [ ] 生成二维码/小程序码\n- [ ] 接入在线客服消息\n\n### 微信服务号\n- [X] 网页授权\n- [X] 发送模板消息\n- [X] 获取用户基础信息\n- [X] 获取用户列表\n- [X] 服务号网页支付\n- [X] 前端调用JSSDK\n\n## 安装\n\n```bash\n$ npm i egg-mp --save\n```\n\n## 启用插件\n\n```js\n// {app_root}/config/plugin.js\nexports.mp = {\n  enable: true,\n  package: 'egg-mp',\n};\n```\n\n## 应用配置\n\n```js\n// {app_root}/config/config.default.js\nexports.mp = {\n  appId: '', // 公众平台应用编号\n  appSecret: '', // 公众平台应用密钥\n  mchId: '', // 商户平台商家编号\n  apiKey: '', // 商户支付密钥\n  notifyUrl: '' // 支付结果回调地址\n};\n```\n\n请查看官网的 [config/config.default.js](config/config.default.js) 获取更详细说明.\n\n## 简单实例\n\n```javascript\nasync login() {\n    const { ctx, service } = this;\n    const { code } = ctx.request.query;\n    let res = await service.mp.login(code);\n    // {\n    //   session_key: \"Sop9yRVgqnCFjsqANnNE2Q==\",\n    //   openid: \"oo17M4gnwK3iQd6dxcA5mLDkoHA8\"\n    // };\n}\n```\n\n## 基础教程\n- [配置项如何找到？](doc/CONFIG.md)\n- 如何搭建环境？\n- 如何本地调试？\n- 登录与授权（获取用户信息）\n- 微信支付（小程序、服务号）\n- 推送消息（服务通知、模板消息）\n- 生成二维码（或小程序码）\n\n## 问题与建议\n\n请在[这里](https://github.com/unclexiao/egg-mp/issues)向我提出问题\n\n## 开源协议\n\n[MIT](LICENSE)\n","funding_links":[],"categories":["仓库"],"sub_categories":["插件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funclexiao%2Fegg-mp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funclexiao%2Fegg-mp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funclexiao%2Fegg-mp/lists"}