{"id":31097364,"url":"https://github.com/invertgeek/mixauth","last_synced_at":"2025-09-16T19:07:04.737Z","repository":{"id":312815438,"uuid":"1043592232","full_name":"InvertGeek/mixauth","owner":"InvertGeek","description":"无需任何手续，让你的应用支持QQ/微信登陆","archived":false,"fork":false,"pushed_at":"2025-09-02T05:50:52.000Z","size":258,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-02T07:25:21.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/InvertGeek.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-24T07:33:32.000Z","updated_at":"2025-09-02T07:13:24.000Z","dependencies_parsed_at":"2025-09-02T07:25:24.544Z","dependency_job_id":"b4e7cf83-e2d7-41a4-886a-0a48a26b33f7","html_url":"https://github.com/InvertGeek/mixauth","commit_stats":null,"previous_names":["invertgeek/mixauth"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/InvertGeek/mixauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InvertGeek%2Fmixauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InvertGeek%2Fmixauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InvertGeek%2Fmixauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InvertGeek%2Fmixauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InvertGeek","download_url":"https://codeload.github.com/InvertGeek/mixauth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InvertGeek%2Fmixauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275469321,"owners_count":25470567,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-09-16T19:07:00.804Z","updated_at":"2025-09-16T19:07:04.721Z","avatar_url":"https://github.com/InvertGeek.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MixAuth\n无需任何手续，让你的应用快速支持 **QQ / 微信** 登录。 \\\n基于nextjs开发\n\n## 在线体验\n- 地址：[https://mixauth.onrender.com/](https://mixauth.onrender.com/)\n\n\n## 功能\n- 支持扫码登录  \n- 实时显示二维码状态，包括是否已扫码、是否过期、是否被手机拒绝登录等  \n\n## 原理\n- 基于官方登录接口逆向实现  \n- **二维码请求**：MixAuth 使用已上线应用的 `appid` 向腾讯请求二维码  \n- **登录状态查询**：通过官方接口查询二维码的登录状态  \n\n## 安全性与稳定性\n\n- **登录方式对比**  \n  - **QQ 登录**：通过 QQ 官方互联接口获取信息，稳定性与可靠性较高  \n  - **微信登录**：存在以下限制：  \n    - 无法直接获取 **微信号**  \n    - 仅能获取 **微信昵称、头像** 等信息 \n    - 返回信息来源于 **腾讯Hr平台接口**，可能随时被官方调整或失效  \n\t- 使用 `UserIdStr` 作为账号唯一标识即可,此为腾讯hr平台账号ID\n\n- **使用建议**  \n  - ✅ **QQ**：推荐作为登录方式  \n  - ⚠️ **微信**：建议仅用于 **账号绑定后的登录**，不推荐作为直接登录入口  \n\n- **当前配置**  \n  - 使用的 `appid`：腾讯Hr平台\n  - 可自行更改为其他appid,只适用于qq\n  - 微信登陆只有回调功能，无法直接通过官方查询账号任何信息\n\n \n\n## 部署\n- 编辑 `src/config.js`，将秘钥改为更复杂的秘钥 \n- 需要 Node.js 运行环境  \n- 安装依赖：`npm i`  \n- 构建项目：`npm run build`  \n- 启动服务：`npm run start`\n- 也可使用：`next start` 或 `yarn start` \n- 可通过命令参数 `next start -p 端口` 或环境变量 `PORT` 指定端口  \n- 可一键部署到 Vercel：[点击部署](https://vercel.com/new/clone?repository-url=https://github.com/InvertGeek/mixauth)  \n\n## 快速接入\n- 可直接使用 iframe 接入  \n- 父页面接收登录回调示例：\n```html\n\u003cscript\u003e\nwindow.addEventListener('message', function(event) {\n  const message = event.data;\n  if (message \u0026\u0026 message.type === 'mixauth_login_result') {\n    const loginResult = message.data;\n    console.log('收到登录结果:', loginResult);\n  }\n});\n\u003c/script\u003e\n```\n\n- 结果格式为：**时间戳 | Base64 编码的登录结果 | HMAC 哈希值**  \n- 校验结果时，请先确认结果中的 **QQ 或微信 UserIdStr 不为空**，然后向 `/api/verify` 接口发送请求校验(后端进行)\n- **必须校验，否则可能被伪造登录信息**\n\n## API 接入\n- 使用接口可进行 API 接入  \n- API 接入无需 verify 校验，自行根据 status 返回结果处理即可  \n- 微信登录成功可能返回空信息，自行校验 UserIdStr 是否为空  \n\n## 接口\n接口请求体格式均为 JSON，方法均为 POST  \n\n### 获取二维码\n**URL**：`/api/qr`  \n**请求体格式**：\n```json\n{\"type\": \"qq|wechat\"}\n```\n\n### 查询二维码状态\n**URL**：`/api/status`  \n**请求体格式**：\n```json\n{\"type\": \"qq|wechat\", \"id\": \"二维码id\"}\n```\n\n### 校验登录信息\n**URL**：`/api/verify`  \n**请求体格式**：\n```json\n{\"sign\": \"签名信息\"}\n```\n\n\n\n## 已知问题\n- 只有通过摄像头扫描二维码才可登陆,qq微信禁止保存二维码到相册识别登陆\n\n## Github Star\n[![Stargazers over time](https://starchart.cc/InvertGeek/mixauth.svg?variant=adaptive)](https://starchart.cc/InvertGeek/mixauth)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvertgeek%2Fmixauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvertgeek%2Fmixauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvertgeek%2Fmixauth/lists"}