From a214fa6fc802ee6d98c853f94e9da4899bb49683 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Fri, 8 Nov 2024 15:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=8E=AF=E5=A2=83=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E6=9F=90=E4=BC=81=E4=B8=9A=E8=AF=A6=E7=BB=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../single/controller/ChiefController.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/single/controller/ChiefController.java b/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/single/controller/ChiefController.java index cbff8d0..ce99a8b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/single/controller/ChiefController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/single/controller/ChiefController.java @@ -103,4 +103,26 @@ public class ChiefController { } throw new ServiceException("登陆失败"); } + + + @ApiOperation("政务根据信用代码返回跳转路由") + @GetMapping("/returnUrl") + public AjaxResult returnUrl(@RequestParam("code") String code, + @RequestParam("userToken") String userToken) throws Exception { + //请求的地址 + StringBuilder url = new StringBuilder("http://qyt.sipac.gov.cn/sipsg-enterprise-mobile-manage/#/loginVerify?"); + //当前时间的时间戳 + long timespan = System.currentTimeMillis(); + UserInfoRequestDTO req = new UserInfoRequestDTO(); + req.setClientId(clientId); + req.setUserToken(userToken); + String signature = Base64.encode(HMAC256Config.HmacSHA256(JSONUtil.parse(req).toString() + timespan, clientSecret)); + url.append("signature=").append(signature); + url.append("×pan=").append(timespan); + url.append("&userToken=").append(userToken); + url.append("&clientid=").append(clientId); + url.append("&gourl=") + .append(URLEncoder.encode("https://qyt.sipac.gov.cn/sipsg-enterprise-mobile-manage/#/workPlat/search/enterprise/detail?id="+code,"UTF-8")); + return AjaxResult.success(url.toString()); + } }