将当前管理员相关的信息、权限等接口,迁移到 Passport 模块,更加统一
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package cn.iocoder.common.framework.util;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 校验工具类
|
||||
*/
|
||||
public class ValidationUtil {
|
||||
|
||||
private static Pattern PATTERN_URL = Pattern.compile("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]");
|
||||
|
||||
public static boolean isMobile(String mobile) {
|
||||
if (mobile == null || mobile.length() != 11) {
|
||||
return false;
|
||||
@@ -13,4 +17,13 @@ public class ValidationUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
public static boolean isURL(String url) {
|
||||
return StringUtils.hasText(url)
|
||||
&& PATTERN_URL.matcher(url).matches();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(isURL("http://www.iocoder.cn"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user