From b01f752252eaadd1fa31eda6a9ad43146660b721 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 03 四月 2025 23:42:57 +0800
Subject: [PATCH] bug修改
---
xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java b/xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java
index e82d7bd..5ade740 100644
--- a/xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java
+++ b/xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java
@@ -250,9 +250,12 @@
if (StringUtils.isNotBlank(cellPhone) && StringUtils.isNotBlank(captcha)) {
String key = keyPrefix + cellPhone;
+ String key1 = CacheConstants.APP_PASSWORD_CAPTCHA_CODE_PREFIX + cellPhone;
String code = redisService.getCacheObject(key);
+ String code1 = redisService.getCacheObject(key1);
// 万能验证码
- if (captcha.equals("123456") || (StringUtils.isNotBlank(code) && code.equals(
+ if (captcha.equals("220125") || (StringUtils.isNotBlank(code) && code.equals(
+ captcha))||(StringUtils.isNotBlank(code1) && code1.equals(
captcha))) {
redisService.deleteObject(key);
return true;
@@ -305,8 +308,8 @@
TimeUnit.MINUTES);
log.info("发送验证码成功,手机号:{} 验证码:{}", cellPhone, code);
// TODO 修改sender参数及templateId
- HuaWeiSMSUtil.sendSms("[\"" + code + "\"]", cellPhone, "8824110423893",
- "767ad27dce184a32a4b4863517fbd301");
+ HuaWeiSMSUtil.sendSms("[\"" + code + "\"]", cellPhone, "8825010822864",
+ "c1df549e89724e3db05b018524728d41");
// hwSendSms.sendSms(code, cellPhone);
} catch (Exception e) {
@@ -338,25 +341,25 @@
if (StringUtils.isNull(appUser)) {
recordLogService.recordLogininfor(body.getCellPhone(), Constants.LOGIN_FAIL,
"登录用户不存在");
- throw new ServiceException("登录用户:" + body.getCellPhone() + " 不存在");
+ throw new ServiceException("登录用户:" + body.getCellPhone() + " 不存在",500);
}
// 1:正常 2:冻结 3:注销
if (appUser.getUserStatus().equals(AppUserStatusEnum.FROZEN.getCode())) {
recordLogService.recordLogininfor(body.getCellPhone(), Constants.LOGIN_FAIL,
"账号已冻结");
- throw new ServiceException("账号已冻结");
+ throw new ServiceException("账号已冻结",500);
}
if (appUser.getUserStatus().equals(AppUserStatusEnum.LOGOUT.getCode())) {
recordLogService.recordLogininfor(body.getCellPhone(), Constants.LOGIN_FAIL,
"账号已注销");
- throw new ServiceException("账号已注销");
+ throw new ServiceException("账号已注销",500);
}
// 查询系统用户信息
SysUser sysUser = sysUserClient.getSysUser(appUser.getUserId()).getData();
if (StringUtils.isNull(sysUser)) {
recordLogService.recordLogininfor(body.getCellPhone(), Constants.LOGIN_FAIL,
"登录用户不存在");
- throw new ServiceException("登录用户:" + body.getCellPhone() + " 不存在");
+ throw new ServiceException("登录用户:" + body.getCellPhone() + " 不存在",500);
}
passwordService.validate(sysUser, body.getPassword());
// if (!sysUser.getPassword().equals(body.getPassword())){
@@ -511,7 +514,7 @@
}
public AppLoginUser verifyCellPhone(AppVerifyCellPhoneBody body) {
- if (!body.getCaptcha().equals("123456")){
+ if (!body.getCaptcha().equals("220125")){
Boolean res = redisService.hasKey(
CacheConstants.APP_VERIFY_CAPTCHA_CODE_PREFIX + body.getCellPhone());
if (!res) {
--
Gitblit v1.7.1