| | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import static cn.gistack.alerts.sms.util.SmsUtils.validator; |
| | | import static cn.gistack.common.cache.CacheNames.PHONE_KEY; |
| | | |
| | | /** |
| | |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 校验手机号码 |
| | | */ |
| | | public static boolean validator(String phone) { |
| | | if (null!=phone && !phone.equals("")) { |
| | | String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$"; |
| | | if (phone.length() != 11) { |
| | | return false; |
| | | } else { |
| | | Pattern p = Pattern.compile(regex); |
| | | Matcher m = p.matcher(phone); |
| | | boolean isMatch = m.matches(); |
| | | return isMatch; |
| | | } |
| | | } |
| | | return false; |
| | | } |