| | |
| | | // WxUtils.verifySignature(data.getRawData(), sessionKey, data.getSignature()); |
| | | // } |
| | | if(StringUtils.isEmpty(data.getEncryptedData()) || StringUtils.isEmpty(data.getIv())){ |
| | | return AjaxResult.success(); |
| | | return AjaxResult.success("已拒绝授权"); |
| | | } |
| | | AppletUserDecodeData appletUserDecodeData = WxUtils.encryptedData(data.getEncryptedData(), sessionKey, data.getIv()); |
| | | appletUserDecodeData.setOpenId(openid); |
| | | return AjaxResult.success(appUserService.wxLogin(appletUserDecodeData)); |
| | | return AjaxResult.success(appUserService.wxLogin(appletUserDecodeData,data.getInviteUserId())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 测试用 |
| | | * @param appletUserDecodeData |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过code获得openid,获取用户信息",tags = {"微信小程序登录"}) |
| | | @PostMapping("/openIdByJsCodeTest") |
| | | public AjaxResult<Map<String, Object>> openIdByJsCode(@RequestBody AppletUserDecodeData appletUserDecodeData) { |
| | | return AjaxResult.success(appUserService.wxLogin(appletUserDecodeData, null)); |
| | | } |
| | | } |