| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | out.print(JsonUtil.loadFalseResult(4, "电话号码格式不正确"));
|
| | | return;
|
| | | }
|
| | | smsService.sendLoginVCode(phone, 6);
|
| | |
|
| | | smsService.sendLoginVCode(acceptData.getSystem(), phone, 6);
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | } catch (SMSException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param phone
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "sendMSMLogin", method = RequestMethod.POST)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | sendMSNnew(phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | sendMSNnew(acceptData.getSystem(), phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | sendMSNnew(phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | sendMSNnew(acceptData.getSystem(), phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
|
| | | public void sendMSNnew(String phone, boolean slideVerify, int type, String key, PrintWriter out) {
|
| | | public void sendMSNnew(SystemEnum system, String phone, boolean slideVerify, int type, String key, PrintWriter out) {
|
| | | try {
|
| | | int count = 0;
|
| | | String cachekey = null;
|
| | |
| | |
|
| | | if (type == 1) {
|
| | | // 登录验证码
|
| | | smsService.sendLoginVCode(phone, 4);
|
| | | smsService.sendLoginVCode(system, phone, 4);
|
| | | } else if (type == 2) {
|
| | | // 绑定验证码
|
| | | smsService.sendBindVCode(phone, 4);
|
| | | smsService.sendBindVCode(system, phone, 4);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 注销账户短信验证
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param phone
|
| | |
| | | count++;
|
| | | redisManager.cacheCommonString(cachekey, count + "", 60 * 60);
|
| | | // 发送验证码
|
| | | smsService.sendRemoveVCode(phone, 4);
|
| | | smsService.sendRemoveVCode(acceptData.getSystem(), phone, 4);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("发送成功"));
|
| | | } catch (SMSException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|