| | |
| | | import com.ruoyi.common.core.utils.page.Checker; |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | |
| | | public AuctionSalesroom getAuctionBidRecordOne(ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO) { |
| | | R<SysUser> r=sysUserClient.queryUserByPhone(arepartAuctionBidRecordDTO.getPhone()); |
| | | SysUser sysUser=r.getData(); |
| | | |
| | | if (sysUser!=null){ |
| | | if (sysUser==null){ |
| | | throw new ServiceException("手机号未注册"); |
| | | } |
| | | |
| | | if (!sysUser.getPassword().equals(arepartAuctionBidRecordDTO.getPassword())){ |
| | | if (!SecurityUtils.matchesPassword(arepartAuctionBidRecordDTO.getPassword(), sysUser.getPassword())){ |
| | | throw new ServiceException("密码输入错误"); |
| | | } |
| | | |
| | |
| | | if (appMiniLoginDto.getType()==1) { |
| | | if (appMiniLoginDto.getAuth_code() == null || appMiniLoginDto.getAuth_code().length() == 0) { |
| | | } else { |
| | | /* AppMiniLoginVO user=new AppMiniLoginVO(); |
| | | //String serverUrl, String appId, String privateKey, String format,String charset, String alipayPublicKey, String signType |
| | | //实例化客户端 参数:正式环境URL,Appid,商户私钥 PKCS8格式,字符编码格式,字符格式,支付宝公钥,签名方式 |
| | | AlipayClient alipayClient = new DefaultAlipayClient(ALIPAY_BORDER_PROD,APP_ID_PROD, APP_PRIVATE_KEY, "json", "GBK", ALIPAY_PUBLIC_KEY, "RSA2"); |
| | | AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest(); |
| | | // 值为authorization_code时,代表用code换取 |
| | | request.setGrantType("authorization_code"); |
| | | //授权码,用户对应用授权后得到的 |
| | | request.setCode(appMiniLoginDto.getAuth_code()); |
| | | //这里使用execute方法 |
| | | AlipaySystemOauthTokenResponse response = null; |
| | | try { |
| | | response = alipayClient.execute(request); |
| | | } catch (AlipayApiException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //刷新令牌,上次换取访问令牌时得到。见出参的refresh_token字段 |
| | | |
| | | //返回成功时 就将唯一标识返回 |
| | | if (response.isSuccess()) { |
| | | System.out.println("调用成功"); |
| | | //我这里只返回了一个字段给前端用 |
| | | String user1= response.getOpenId(); |
| | | appMiniLoginVo.setZfbuserid(response.getOpenId()); |
| | | AlipayUserInfoShareResponse alipayUserInfoShareResponse= null; |
| | | try { |
| | | AlipayUserInfoShareRequest request1 = new AlipayUserInfoShareRequest(); |
| | | AlipayUserInfoShareResponse response1 = alipayClient.execute(request1, response.getAccessToken()); |
| | | appMiniLoginVo.setPhone(response1.getPhone()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(alipayUserInfoShareResponse.getPhone()); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | String response = JSON.parseObject(appMiniLoginDto.getAuth_code()).getString("response"); |
| | | |
| | | //1. 获取验签和解密所需要的参数 |
| | | Map<String, String> openapiResult = JSON.parseObject(appMiniLoginDto.getAuth_code(), |
| | | new TypeReference<Map<String, String>>() { |
| | |
| | | plainData = content; |
| | | } |
| | | |
| | | Map<String, String> openapiResult1 = JSON.parseObject(plainData, |
| | | new TypeReference<Map<String, String>>() { |
| | | }, Feature.OrderedField); |
| | | |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(openapiResult1.get("mobile")); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | appMiniLoginVo.setPhone(openapiResult1.get("mobile")); |
| | | } |
| | | }else{ |
| | | |