wang-hao-jie
2022-01-07 0f2202dfcea3309c1b0e7515f6db5fbdc83d51d1
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){
        //微信端登录code
        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");