From 7167a7cdf3055fa15e5aba347138cd1d37394eea Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 12 三月 2026 11:02:48 +0800
Subject: [PATCH] 运维人员导入校验手机号
---
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java
index b524d86..16ef6cc 100644
--- a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java
+++ b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java
@@ -2,6 +2,7 @@
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.PhoneUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -353,6 +354,10 @@
xpOperationsUser.setNickName(exportOperationsUserVo.getNickName());
xpOperationsUser.setUniqueNumber(exportOperationsUserVo.getUniqueNumber());
xpOperationsUser.setAvatar(exportOperationsUserVo.getAvatar());
+ boolean isPhone = PhoneUtil.isPhone(exportOperationsUserVo.getPhoneNumber());
+ if (!isPhone) {
+ throw new ServiceException("以下帐号格式不正确:", I18nKeyConstant.ACCOUNT_FORMAT_ERROR, new Object[]{exportOperationsUserVo.getPhoneNumber()});
+ }
xpOperationsUser.setPhoneNumber(exportOperationsUserVo.getPhoneNumber());
xpOperationsUser.setPassword(SecurityUtils.encryptPassword("a123456"));
xpOperationsUser.setRemarks(exportOperationsUserVo.getRemarks());
--
Gitblit v1.7.1