{"id":22468935,"url":"https://github.com/huijiewei/yii2-wechat","last_synced_at":"2025-08-02T08:32:47.963Z","repository":{"id":56986941,"uuid":"137576642","full_name":"huijiewei/yii2-wechat","owner":"huijiewei","description":"Yii2 微信扩展","archived":false,"fork":false,"pushed_at":"2024-10-29T05:53:14.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-29T14:43:27.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huijiewei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-16T11:46:51.000Z","updated_at":"2024-10-29T05:52:01.000Z","dependencies_parsed_at":"2022-08-21T13:20:22.456Z","dependency_job_id":null,"html_url":"https://github.com/huijiewei/yii2-wechat","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huijiewei%2Fyii2-wechat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huijiewei%2Fyii2-wechat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huijiewei%2Fyii2-wechat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huijiewei%2Fyii2-wechat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huijiewei","download_url":"https://codeload.github.com/huijiewei/yii2-wechat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228455051,"owners_count":17922772,"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":[],"created_at":"2024-12-06T11:20:42.518Z","updated_at":"2024-12-06T11:20:43.119Z","avatar_url":"https://github.com/huijiewei.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yii2-wechat\nYii2 微信扩展\n\n本扩展优化了微信网页授权流程\n\n基于 [w7corp/easywechat](https://github.com/w7corp/easywechat).       \n\n## 安装\n```\ncomposer require huijiewei/yii2-wechat\n```\n\n## 配置\n\n增加 `component` 配置到 `config/main.php`:\n\n```php\n\n'components' =\u003e [\n\t// ...\n\t// componentId 可以自定义多个微信公众号进行配置\n\t'wechat' =\u003e [\n\t\t'class' =\u003e 'huijiewei\\wechat\\Wechat',\n\t\t// 'appConfig' =\u003e [],  # 公众号配置\n\t\t// 'paymentConfig' =\u003e [],  # 支付配置\n\t\t// 'miniProgramConfig' =\u003e [],  # 小程序配置\n\t\t// 'openPlatformConfig' =\u003e [],  # 开放平台配置\n\t\t// 'workConfig' =\u003e [],  # 企业微信配置\n\t],\n\t// ...\n]\n```\n\n[配置文档](https://easywechat.com/6.x/official-account/config.html)\n\n## 配置数据库\n```bash\nphp yii migrate --migrationPath=@vendor/huijiewei/yii2-wechat/src/migrations\n```\n\n## 用法\n\n##### 微信网页授权:\n```php\nif(Wechat::getIsWechatClient()) {\n    $wechatAuthorize = new WechatAuthorize([\n        'wechat' =\u003e 'wechat', // componentId, 默认是 wechat\n    ]);\n    \n    if(!$wechatAuthorize-\u003eisAuthorized()) {\n        return $wechatAuthorize-\u003eauthorizeRequired()-\u003esend();\n    }\n}\n```\n\n##### JSSDK\n```php\nWechatShareWidget::widget([\n    'wechat' =\u003e 'wechat', // componentId, 默认是 wechat\n    'shareUrl' =\u003e '分享链接',\n    'shareIcon' =\u003e '分享图标',\n    'shareTitle' =\u003e '分享标题',\n    'shareDescription' =\u003e '分享描述',\n]);\n```\n\n### 更多文档\n查阅 [EasyWeChat 文档](https://www.easywechat.com/docs).\n\n感谢 `w7corp/easywechat`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuijiewei%2Fyii2-wechat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuijiewei%2Fyii2-wechat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuijiewei%2Fyii2-wechat/lists"}