修改注册送券内容

dev-discount
袁野 2 years ago
parent b0b4584e63
commit 7cdc44424f
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  2. 30
      hai-service/src/main/java/com/hai/common/utils/BaiduUtils.java

@ -92,6 +92,8 @@ public class WechatController {
// 记录登录信息
String requestIp = RequestUtils.getIpAddress(request);
JSONObject object =BaiduUtils.ipLocation(requestIp);
log.error("origin encryptedData:" + encryptedData + ";iv:" + iv);
//校验openId不能为空
//encryptedData,iv与unionId不能同时为空

@ -0,0 +1,30 @@
package com.hai.common.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 百度工具
* @className: BaiduUtis
* @author: HuRui
* @date: 2022/10/21
**/
public class BaiduUtils {
private static Logger log = LoggerFactory.getLogger(BaiduUtils.class);
/**
* IP 定位
* @param ip ip地址
* @return
*/
public static JSONObject ipLocation(String ip) {
JSONObject response = HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=" + ip);
log.info(response.toJSONString());
return response;
}
}
Loading…
Cancel
Save