fix: 后端接口增加日志打印,查看具体调用链条的参数

This commit is contained in:
zyd
2022-06-14 15:49:02 +08:00
parent 3379ac54ca
commit d393e0d7fe
2 changed files with 5 additions and 4 deletions
@@ -15,6 +15,7 @@ import com.adc.da.sys.service.IUserEOService;
import com.adc.da.util.Encodes;
import com.adc.da.util.PasswordUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -127,7 +128,9 @@ public class LoginRestController {
@PostMapping(value = "/getTokenToWeLink")
@ResponseBody
public ResponseMessage getIftappCodeByWelinkCode(HttpServletRequest request, WeLinkVO linkVO) throws UnsupportedEncodingException {
log.info(JSONObject.toJSONString(linkVO));
String account = weLinkUtil.getIftappCodeByWelinkCode(linkVO);
log.info("userAccount:" +account);
if(StringUtils.isBlank(account)){
return Result.error("r0011", "用户不存在");
}
@@ -34,9 +34,8 @@ public class WeLinkUtil {
}
String access_token_str = okHttpUtil.post(access_url+"getIftappCodeByWelinkCode",param,new HashMap<>());
JSONObject atJsonObj = JSONObject.fromObject(access_token_str);
System.out.println("AccessTokenJSON:" + atJsonObj);
log.info("AccessTokenJSON: "+access_token_str);
if (atJsonObj.has("data")) {
System.out.println("data:" + atJsonObj.get("data"));
JSONObject obj = JSONObject.fromObject(atJsonObj.getOrDefault("data",""));
if(obj.has("access_token")){
@@ -50,10 +49,9 @@ public class WeLinkUtil {
param_p.put("code",access_token);
String principal_json = okHttpUtil.get(access_url+"getUserInfoByAuthCode",param_p,new HashMap<>());
JSONObject pfjsonObj = JSONObject.fromObject(principal_json);
log.info("getUserInfoByAuthCode "+principal_json);
if (pfjsonObj.has("data")) {
System.out.println("data:" + pfjsonObj.get("data"));
JSONObject obj = JSONObject.fromObject(pfjsonObj.getOrDefault("data",""));
if(obj.has("username")){
return obj.getOrDefault("username","").toString();
}