API DocsAPI Docs
get/api/auth/wechat/authCallback
get/api/auth/wechat/authCallback
微信授权回调
Basic Information
Request Method:
get
Request URL:
https://abit.fun/api/auth/wechat/authCallback
Tags:
用户认证
Description
处理微信授权后的回调,接收授权码,获取访问令牌和OpenID。
注意: 此接口通常不直接由前端调用,而是由微信服务器在用户授权后自动调用。
Query Parameters
Query Parameters Explanation
Query parameters are added at the end of the URL, starting with a question mark, for example:
https://abit.fun/api/auth/wechat/authCallback?code=example&state=example
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
code | string | Required | example | 微信授权码 |
state | string | Required | example | 状态码,用于防止CSRF攻击和关联重定向URL |
Response Example
302授权成功,重定向到前端指定的URL,并设置cookie
400授权失败,参数错误
401授权失败,微信API返回错误
500