This commit is contained in:
X1627315083
2025-06-19 10:07:11 +08:00
parent 47223f7e95
commit 9b15d988f0
3 changed files with 49 additions and 38 deletions

View File

@@ -5,7 +5,18 @@ const isEmail = (email) => {
let result = reg.test(email)
return result
}
function getUniversalZoomLevel() {
// 现代浏览器方案
if (window.visualViewport) {
return window.visualViewport.scale;
}
// 备用方案1
if (window.devicePixelRatio) {
return window.devicePixelRatio;
}
// 备用方案2不精确
return window.outerWidth / window.innerWidth;
}
const getUploadUrl = () => {
let url = process.env.VUE_APP_BASE_URL || ''
// let url = "http://18.167.251.121:10086"
@@ -569,6 +580,7 @@ function segmentImage(markerImage,fullImage,size){
export {
isEmail,
getUploadUrl,
getUniversalZoomLevel,
rgbaToHex,
getMinioUrl,
base64ToFile,