mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-12-23 10:57:15 +08:00
feat: 存储管理S3存储配置填充默认域名 (#21)
This commit is contained in:
@@ -8,3 +8,9 @@ export const isExternal = (path: string) => {
|
||||
export function isHttp(url: string) {
|
||||
return url.includes('http://') || url.includes('https://')
|
||||
}
|
||||
|
||||
/** 判断 字符串 是否是 ipv4 */
|
||||
export function isIPv4(ip: string): boolean {
|
||||
const ipv4Pattern = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
|
||||
return ipv4Pattern.test(ip)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user