| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | | // 清空限制
|
| | | redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
|
| | | // 清理次数
|
| | | redisManager.removeCommonString("sendMSNLoginCount" + phone);
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.SMSLoginCount, phone);
|
| | | redisManager.removeCommonString(key);
|
| | |
|
| | |
|
| | | // 采用redis事务防止一个手机号多次注册问题
|
| | | String watchKey = StringUtil.Md5("REGISTER:" + phone);
|
| | |
| | |
|
| | | UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | if (userInfo == null) {
|
| | | String longinKey = StringUtil.Md5("WXLogin:" + weiXinUser.getUnionid());
|
| | | redisManager.cacheCommonString(longinKey, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
|
| | | throw new UserAccountException(101, longinKey);
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5("WXLogin:" + weiXinUser.getUnionid()));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
|
| | | throw new UserAccountException(101, key);
|
| | | }
|
| | | // 更新账户登录信息
|
| | | updateLonginInfo(userInfo, loginType, request);
|