Files
jurong_circle_front_app/util/common.js
2025-09-19 16:45:02 +08:00

20 lines
435 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 校验
export const validatePhone = (phone) => {
const reg = /^1[3-9]\d{9}$/;
return reg.test(phone);
};
export const getImageUrl = (imagePath) => {
if (!imagePath ) return ''
if (imagePath.startsWith('http')) return imagePath
// const baseURL = "http://192.168.1.43:3000"
// 如果图片路径以/uploads开头直接返回原路径
if (imagePath.startsWith('/uploads')) {
return `${imagePath}`
}
return fullUrl
}