| | |
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SMSService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | |
| | | @RequestSerializableByKey(key = "#phone+'-'+#uid+'-'+#type")
|
| | | @RequestMapping(value = "sendSMS", method = RequestMethod.POST)
|
| | | public void sendMSM(AcceptData acceptData, String phone, Long uid, Integer type, PrintWriter out) {
|
| | | if (Constant.IS_TEST) {
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | return;
|
| | | }
|
| | | sendMSM(acceptData, phone, uid, type, StringUtil.Md5(phone + "-" + "-" + uid + "-" + type), out);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | phone = phone.replaceAll(" ", "");
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | return;
|
| | | }
|
| | |
|
| | | sendMSNnew(phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | @RequestSerializableByKey(key = "#acceptData.device+'-'+#phone")
|
| | | @RequestMapping(value = "sendMSMBind", method = RequestMethod.POST)
|
| | | public void sendMSMBind(AcceptData acceptData, String phone, boolean slideVerify, PrintWriter out) {
|
| | | public void sendMSMBind(AcceptData acceptData, String phone, boolean slideVerify, Long uid, PrintWriter out) {
|
| | | if (phone == null || !StringUtil.isMobile(phone.replaceAll(" ", ""))) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "手机号输入有误,请修改"));
|
| | | return;
|
| | |
| | | //
|
| | | // 判断手机号码是否被封禁
|
| | | UserInfo phoneUser = userInfoService.getEffectiveUserInfoByPhone(phone);
|
| | | if (phoneUser != null) {
|
| | | if (phoneUser != null && uid != null) {
|
| | | out.print(JsonUtil.loadFalseResult(9001, "该电话号码被占用"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | String cachekey = null;
|
| | | if (type == 1) {
|
| | | // 登录验证码
|
| | | cachekey = "sendMSNLoginCount" + phone;
|
| | | cachekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.SMSLoginCount, phone + "");
|
| | | } else if (type == 2) {
|
| | | // 绑定验证码
|
| | | cachekey = "sendMSNBindCount" + phone;
|
| | | cachekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.SMSBindCount, phone + "");
|
| | | }
|
| | |
|
| | | if (cachekey == null) {
|