From 3be01520d00eaba7a9d058927b7255753c351351 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期四, 06 六月 2024 14:33:23 +0800 Subject: [PATCH] 短信 obs 支付宝支付 --- ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java index 01aa478..b82fcae 100644 --- a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java +++ b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java @@ -461,20 +461,20 @@ .eq("phone", phone)); if (tUser1 != null) { if (tUser1.getState() == 2) { - throw new GlobalException("登录失败,您的账号已被冻结!"); + return R.freeze("登录失败,您的账号已被冻结!"); } } else { // 手机验证码校验 if (!phoneCode.equals("123456")) { Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone); if (null == redisPhoneCode) { - throw new GlobalException("登录失败,手机验证码已过期!"); + return R.errorCode("登录失败,手机验证码无效!"); } else { // redis 验证码的value 为 code:时间戳 String rCodeAndTime = String.valueOf(redisPhoneCode); String rCode = rCodeAndTime.split(":")[0]; if (!rCode.equalsIgnoreCase(phoneCode)) { - throw new GlobalException("登录失败,手机验证码输入有误!"); + return R.errorCode("登录失败,手机验证码无效!"); } else { tUser1 = getUser(phone); userService.save(tUser1); @@ -592,7 +592,7 @@ @ApiImplicitParams({ @ApiImplicitParam(value = "手机号", name = "phone", dataType = "string", required = true), }) - public R<?> sendPhoneCode(@RequestParam String phone) { + public R<?> sendPhoneCode(@RequestParam String phone) throws Exception { return userService.phoneCode(phone) ? R.ok() : R.fail(); } -- Gitblit v1.7.1