From 5e7b0ed4a154ad067cbcf4aa1a1c7cce32f9864c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 26 四月 2024 18:02:17 +0800 Subject: [PATCH] 唯品会链接解析升级 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 44 insertions(+), 7 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java index b03e865..70dd0ba 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java @@ -13,6 +13,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import com.ks.push.service.BDeviceTokenService; import com.yeshi.fanli.entity.SystemEnum; import com.yeshi.fanli.entity.SystemFunction; import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException; @@ -20,6 +21,7 @@ import com.yeshi.fanli.util.*; import com.yeshi.fanli.vo.taobao.TaoBaoUser; import com.yeshi.fanli.vo.user.QQUserInfoVO; +import org.apache.dubbo.config.annotation.Reference; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -178,6 +180,9 @@ @Resource private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService; + @Reference(version = "1.0", check = false) + private BDeviceTokenService bDeviceTokenService; + /** * 鏂扮増鐧诲綍 V1.5.3 @@ -209,6 +214,14 @@ switch (loginType) { //鐢佃瘽鍙风爜鐧诲綍 case 1: { + if (!StringUtil.isNullOrEmpty(aliAccessToken)) { + long now = System.currentTimeMillis(); + String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); + ; + redisManager.increase(key); + int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); + redisManager.expire(key, expire); + } userInfo = userAccountService.loginPhone(new ProxyIP(request.getRemoteHost(), request.getRemotePort()), loginType, vcode, phone, aliAccessToken, system); } break; @@ -251,13 +264,19 @@ LogHelper.errorDetailInfo(e); } - // 缁戝畾oppo,VIVO鎺ㄩ�� - DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice()); - if (active != null) { - deviceTokenOPPOService.bindUid(uuser.getId(), active.getId()); - deviceTokenVIVOService.bindUid(uuser.getId(), active.getId()); - deviceTokenXMService.bindUid(active.getId(), uuser.getId()); + if (acceptData.getSystem().isNewPush()) { + bDeviceTokenService.bindUid(acceptData.getSystem().name(), StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid(), uuser.getId() + ""); + } else { + // 缁戝畾oppo,VIVO鎺ㄩ�� + DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice()); + if (active != null) { + deviceTokenOPPOService.bindUid(uuser.getId(), active.getId()); + deviceTokenVIVOService.bindUid(uuser.getId(), active.getId()); + deviceTokenXMService.bindUid(active.getId(), uuser.getId()); + } } + + } }); } @@ -361,6 +380,15 @@ if (StringUtil.isNullOrEmpty(key)) { out.print(JsonUtil.loadFalseResult("key鍊间笉鑳戒负绌�")); return; + } + + if (!StringUtil.isNullOrEmpty(aliAccessToken)) { + long now = System.currentTimeMillis(); + String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid())); + ; + redisManager.increase(redisKey); + int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000); + redisManager.expire(redisKey, expire); } String mobile = null; @@ -610,6 +638,15 @@ return; } + //鍗囬珮绾э紝闃叉娑堟伅闃熷垪鏃犳晥锛屾病鑷姩鐢宠楂樼骇 + try { + userVIPPreInfoService.upgradeVipByMyOrder(uid); + } catch (Exception e) { + } + try { + userVIPPreInfoService.upgradeVipByTeamNum(uid); + } catch (Exception e) { + } try { userVIPInfoService.applyVIP(uid); } catch (UserVIPInfoException e) { @@ -923,7 +960,7 @@ redisManager.clearSMSVCode(phone, SMSHistory.TYPE_REMVOE); } - userAccountService.forbiddenUserAll(uid, "鐢ㄦ埛涓诲姩娉ㄩ攢璐︽埛"); + userAccountService.unRegisterUser(uid, "鐢ㄦ埛涓诲姩娉ㄩ攢璐︽埛"); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("娉ㄩ攢鎴愬姛")); } -- Gitblit v1.8.0