类 UserThirdpartWeiXinController
java.lang.Object
net.sohelp.boot.admin.core.base.BaseController
net.sohelp.boot.dev.web.user.UserThirdpartWeiXinController
@RestController("dev-user-thirdpart-weixin")
@RequestMapping("/dev/user/weixin")
public class UserThirdpartWeiXinController
extends BaseController
微信第三方控制器
提供微信扫码登录、绑定与解绑功能。
- 从以下版本开始:
- 2024/10/22 16:33
- 作者:
- ShenganWu
-
字段概要
从类继承的字段 net.sohelp.boot.admin.core.base.BaseController
request, response -
构造器概要
构造器 -
方法概要
从类继承的方法 net.sohelp.boot.admin.core.base.BaseController
error, error, fail, fail, fail, getLoginID, getLoginName, getLoginOrgID, getLoginOrgName, getLoginUser, getNickname, getTenantId, getUserName, getUserNo, i18n, i18n, isAdministrator, isDeveloper, limit, offset, ok, ok, response, response, responseStream, success, success, success, success, validateToken
-
构造器详细资料
-
UserThirdpartWeiXinController
public UserThirdpartWeiXinController()
-
-
方法详细资料
-
wxBinding
@GetMapping("/binding") @Permission("ADMIN") public ApiResult wxBinding() throws IOException, TokenAuthenticationException发起微信绑定流程,引导用户跳转至微信授权页面进行扫码绑定操作。- 返回:
- 成功时返回null(已重定向),失败则返回错误提示信息
- 抛出:
IOException- IO异常TokenAuthenticationException- token认证异常
-
invokeWxBinding
@RequestMapping(value="/binding/callback", method={GET,POST}) @Transactional(rollbackFor=java.lang.Exception.class) public ApiResult invokeWxBinding(@RequestParam Map paramMap) throws Exception 微信授权后的回调接口,用于处理用户的绑定逻辑。 包括获取微信用户信息,并将其与当前登录用户关联。- 参数:
paramMap- 请求参数,包括code等微信授权码及userId- 返回:
- 成功时返回null(已重定向),失败则跳转到错误页
- 抛出:
Exception- 异常情况抛出
-
wxUnbind
@PostMapping("/wx/unbind") @Permission("ADMIN") @Transactional(rollbackFor=java.lang.Exception.class) public ApiResult wxUnbind() throws Exception解除当前用户的微信绑定关系- 返回:
- 解绑结果信息
- 抛出:
Exception- 数据库操作异常或其他业务异常
-