| | |
| | | @ApiOperation("短信验证码") |
| | | public ResponseEntity<Object> verification(@RequestParam String phone) { |
| | | String uuid = key + IdUtil.simpleUUID(); |
| | | System.out.println(phone); |
| | | //创建验证码 |
| | | String verification = (int) ((Math.random() * 9 + 1) * 100000) + ""; |
| | | SendMessageUtils.sendMsg(properties.getUrlSendMsg(), phone, SendMessageUtils.SIGN, |
| | | SendMessageUtils.MESSAGE.replace("{code}", verification), properties); |
| | | redisUtils.set(uuid, verification, time); |
| | | String message = "您的验证码为:" + verification + ",请勿泄露于他人!"; |
| | | SendMessageUtils.sendMsg(properties.getUrlSendMsg(), phone, message, properties); |
| | | return ResponseEntity.ok(R.success(uuid)); |
| | | } |
| | | } |