From 3afa93b3ddac38ec55e54c24e90701994612791f Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期五, 29 三月 2024 10:21:13 +0800
Subject: [PATCH] 新增token 刷新接口
---
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java | 39 ++++++++++++++++++++++++++++++++++-----
1 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
index 2b1de12..1c9198a 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
@@ -42,6 +42,9 @@
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @program: springcloud_k8s_panzhihuazhihuishequ
* @description: 登录
@@ -281,6 +284,16 @@
return tokenService.refreshToken(refreshToken);
}
+
+ @PostMapping("/getNewToken")
+ public R getNewToken(@RequestBody LoginUserInfoVO loginUserInfoVO)
+ {
+ return tokenService.getNewToken(loginUserInfoVO);
+ }
+
+
+
+
@ApiOperation(value = "查询社区")
@PostMapping("listcommunity")
public R listCommunity(@RequestBody ComActVO comActVO) {
@@ -319,10 +332,22 @@
@GetMapping("uu/getQRCode")
public R uuLogin(@RequestParam("couponId") String couponId) {
try {
- WxMaQrcodeService qrCodeService = wxMaConfiguration.getMaService("wx118de8a734d269f0").getQrcodeService();
- byte[] bytes = qrCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId,
- "packageD/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false);
- return R.ok(String.format("data:image/png;base64,%s", Base64.encode(bytes)));
+ //i小懒
+ WxMaQrcodeService wsCodeService = wxMaConfiguration.getMaService("wx98d62711dfbd8425").getQrcodeService();
+ byte[] bytes = wsCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId,
+ "pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false);
+ String res = String.format("data:image/png;base64,%s", Base64.encode(bytes));
+
+ //花城
+ WxMaQrcodeService uuCodeService = wxMaConfiguration.getMaService("wx118de8a734d269f0").getQrcodeService();
+ byte[] hcBytes = uuCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId,
+ "packageD/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false);
+ String hcRes = String.format("data:image/png;base64,%s", Base64.encode(hcBytes));
+
+ Map<String,String> retMap = new HashMap<>();
+ retMap.put("ixiaolan",res);
+ retMap.put("huacheng",hcRes);
+ return R.ok(retMap);
} catch (Exception e) {
log.error("generate QRCode failed:" + e.getMessage());
return R.fail("generate QRCode failed");
@@ -333,7 +358,11 @@
@PostMapping("tfLogin")
public R tfLogin(@RequestBody UuLoginVO uuLoginVO){
try {
- uuLoginVO.setMobile(RSAUtils.decrypt(uuLoginVO.getMobile(), Constants.PRIVATE_KEY));
+ log.info("天府通办登录【{}】", JSONObject.toJSONString(uuLoginVO.getMobile()));
+ String str=RSAUtils.decrypt(uuLoginVO.getMobile(), Constants.PRIVATE_KEY);
+ log.info("天府通办登录【{}】", JSONObject.toJSONString(str));
+ uuLoginVO.setMobile(str);
+ //测试是否能正常添加用户
} catch (Exception e) {
e.printStackTrace();
return R.fail();
--
Gitblit v1.7.1