Commit 45e3bca3 by 吴迪

【新增】请求gds接口限制

parent 264befaa
...@@ -723,6 +723,11 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -723,6 +723,11 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
url = "http://wsdt.gs1cn.org/anccoh/login?method=phoneSSO&phone=" + phone_M; url = "http://wsdt.gs1cn.org/anccoh/login?method=phoneSSO&phone=" + phone_M;
log.info(url); log.info(url);
} }
String value = redisUtils.get("gds:" + phone);
if(StringUtils.isNotBlank(value)) {
throw new RRException("请求频繁,请3s后重试!");
}
redisUtils.set("gds:"+phone,"Y",3);
token = HttpUtil.get(url); token = HttpUtil.get(url);
JSONObject jsonObject = JSON.parseObject(token); JSONObject jsonObject = JSON.parseObject(token);
log.info(jsonObject.toString()); log.info(jsonObject.toString());
...@@ -731,12 +736,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -731,12 +736,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
if (!"200".equals(status)) { if (!"200".equals(status)) {
throw new RRException("获取token失败" + msg); throw new RRException("获取token失败" + msg);
} }
String value = redisUtils.get("gds:" + phone);
if(StringUtils.isNotBlank(value)) {
throw new RRException("请求频繁,请3s后重试!");
}
redisUtils.set("gds:"+phone,"Y",3);
log.info("http://wsdt.gs1cn.org/anccoh/login?method=redirect&token=" + msg); log.info("http://wsdt.gs1cn.org/anccoh/login?method=redirect&token=" + msg);
return "http://wsdt.gs1cn.org/anccoh/login?method=redirect&token=" + msg; return "http://wsdt.gs1cn.org/anccoh/login?method=redirect&token=" + msg;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment