fix(user): 修复用户注册逻辑并更新Redis键格式

- 修改设备模板和监测点位置的Redis键格式,统一添加冒号后缀
- 移除未使用的ResponseEntity导入
- 简化用户注册流程,移除重复的手机号验证逻辑
- 在网关配置中添加新的白名单接口路径
This commit is contained in:
xy
2026-06-18 15:29:05 +08:00
parent 21fe98db49
commit 6eedee7783
3 changed files with 27 additions and 34 deletions

View File

@@ -13,7 +13,7 @@ public interface AppRedisKey {
/**
* 设备模板前缀
*/
String MODEL = "MODEL";
String MODEL = "MODEL:";
/**
@@ -39,7 +39,7 @@ public interface AppRedisKey {
/**
* 监测点位置数据
*/
String LINE_POSITION = "LINEPOSITION";
String LINE_POSITION = "LINEPOSITION:";
/**
* rocketMQ消费key

View File

@@ -249,6 +249,7 @@ whitelist:
- /harmonic-boot/comAccess/getComAccessData
- /harmonic-boot/harmonic/getHistoryResult
- /event-boot/transient/getTransientAnalyseWave
- /cs-system-boot/appVersion/getLastData
# - /**
#开始
# - /advance-boot/**

View File

@@ -25,7 +25,6 @@ import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -106,12 +105,6 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
throw new BusinessException(UserResponseEnum.DEV_CODE_WRONG);
}
judgeCode(phone, code);
String password = null;
//先根据手机号查询是否已被注册
User user = this.lambdaQuery().eq(User::getPhone,phone).ne(User::getState,0).one();
if (!Objects.isNull(user)){
throw new BusinessException(UserResponseEnum.REGISTER_PHONE_REPEAT);
} else {
//新增用户配置表
UserSet userSet = userSetService.addAppUserSet();
//新增用户表
@@ -130,14 +123,13 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
appInfoSet.setF47Function(0);
appInfoSetService.save(appInfoSet);
//发送用户初始密码
password = redisUtil.getStringByKey(newUser.getId());
String password = redisUtil.getStringByKey(newUser.getId());
String content = SmsUtil.getLianTongMessageTemplate("3", password);
smsSendService.sendSmsWithRetry(phone,content,"verify_code");
redisUtil.delete(newUser.getId());
//删除验证码
deleteCode(phone);
}
}
@Override
public void modifyPsd(String userId, String phone, String code, String password, String devCode) {