From 0f2202dfcea3309c1b0e7515f6db5fbdc83d51d1 Mon Sep 17 00:00:00 2001
From: wang-hao-jie <1550036656@qq.com>
Date: 星期五, 07 一月 2022 11:06:51 +0800
Subject: [PATCH] 违章记录

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
index 8531514..284354a 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
@@ -10,6 +10,7 @@
 import cn.exrick.xboot.your.util.HttpUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -75,6 +76,8 @@
         if(one==null){
             return ResultUtil.error(openid);//棣栨鐧婚檰闇�缁戝畾闆跺敭璁稿彲璇�
         }else {
+            one.setLoginNum(one.getLoginNum()+1);
+            iCustomerService.saveOrUpdate(one);
             return ResultUtil.data(one,"鐧诲綍鎴愬姛");
         }
     }
@@ -82,7 +85,7 @@
     public static JSONObject getSessionKeyOrOpenId(String code){
         //寰俊绔櫥褰昪ode
         String wxCode = code;
-        String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=wx0f10f6d253f3ee6b&secret=4d4cbc8da31a96559114ad693de70631&grant_type=authorization_code&js_code="+code;
+        String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=wx77c0d2c54010b7e4&secret=2282710e890670e916c189347d70a7c5&grant_type=authorization_code&js_code="+code;
         JSONObject jsonObject = JSONUtil.parseObj( HttpUtil.get(requestUrl));
         return jsonObject;
     }
@@ -145,7 +148,8 @@
         String latestGps = haiKangPost.findLatestGps(carids);
         JSONObject jsonObject = JSONUtil.parseObj(latestGps);
         String data = jsonObject.getStr("data");
-        JSONObject jsonObject2 = JSONUtil.parseObj(data);
+        JSONArray objects = JSONUtil.parseArray(data);
+        JSONObject jsonObject2 = objects.getJSONObject(0);
         Integer lng = jsonObject2.getInt("longitude");
         Integer lat = jsonObject2.getInt("latitude");
 

--
Gitblit v1.9.1