From 3ebbc15764ff0574f1024eb485e23d2df3e8730b Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 17 四月 2019 11:58:40 +0800 Subject: [PATCH] 阿里云短信优化,分享信息优化 --- fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java | 30 +++++++++++++++++------------- 1 files changed, 17 insertions(+), 13 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java b/fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java index ad351ae..5ae3bc5 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java @@ -82,7 +82,10 @@ String openUid = data.optString("taobao_open_uid"); String taoBaoUid = data.optString("taobao_user_id"); String nickName = data.optString("taobao_user_nick"); - + try { + nickName = URLDecoder.decode(nickName, "UTF-8"); + } catch (Exception e) { + } // LogHelper.test("uid:" + uid + "\n accessToken:" + accessToken); // 鑾峰彇娓犻亾ID涓庝細鍛業D @@ -92,15 +95,15 @@ if (StringUtil.isNullOrEmpty(relationId)) LogHelper.test(uid + "娓犻亾澶囨澶辫触"); try { - userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid,nickName, true); + userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, nickName, true); } catch (UserExtraTaoBaoInfoException e) { LogHelper.test(e.getMsg()); errCode = 5; } - } else if ("zigou".equalsIgnoreCase(source)) { + } else if ("zigou".equalsIgnoreCase(source)) { String specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET); - + if (StringUtil.isNullOrEmpty(specialId)) LogHelper.test(uid + "浼氬憳澶囨澶辫触"); try { @@ -110,17 +113,18 @@ errCode = 5; } } else if ("bind".equalsIgnoreCase(source)) { - + boolean bindInfo = true; // 缁戝畾娣樺疂锛歏1.5.3 - String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 娓犻亾ID + String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, + TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 娓犻亾ID if (StringUtil.isNullOrEmpty(relationId)) { LogHelper.test(uid + "娓犻亾澶囨澶辫触"); bindInfo = false; } - + String specialId = null; - if(bindInfo) { + if (bindInfo) { specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET); if (StringUtil.isNullOrEmpty(specialId)) { @@ -128,20 +132,20 @@ bindInfo = false; } } - + if (!bindInfo) { errCode = 5;// 淇℃伅鑾峰彇涓嶅叏 } else { try { - userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName, true); + userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName, + true); } catch (UserExtraTaoBaoInfoException e) { LogHelper.test(e.getMsg()); errCode = 6; } } - + } - if (!StringUtil.isNullOrEmpty(nickName)) try { @@ -156,7 +160,7 @@ record.setTaoBaoUserNick(nickName); record.setCreateTime(new Date()); taoBaoUnionAuthRecordService.addAuthRecord(record); - + } catch (Exception e) { errCode = 4; try { -- Gitblit v1.8.0