reactor:osName 的获取,从 getSystemInfoSync 迁移到 getDeviceInfo

reactor:pixelRatio/windowHeight/windowWidth 的获取,从 getSystemInfoSync 迁移到 getWindowInfo
This commit is contained in:
YunaiV
2025-04-29 20:13:18 +08:00
parent 04bb5e65d3
commit 82aada5ecd
8 changed files with 21 additions and 22 deletions
@@ -3,7 +3,8 @@ export const isBase64 = (path) => /^data:image\/(\w+);base64/.test(path);
export function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, delay))
}
let {platform, SDKVersion} = uni.getSystemInfoSync()
let platform = uni.getDeviceInfo().platform
let SDKVersion = uni.getSystemInfoSync().SDKVersion
export const isPC = /windows|mac/.test(platform)
// 缓存图片
let cache = {}
@@ -316,7 +317,7 @@ export function getImageInfo(path, useCORS) {
// #ifdef APP-PLUS
// console.log('getImageInfo', +new Date() - time)
// ios 比较严格 可能需要设置跨域
if(uni.getSystemInfoSync().osName == 'ios' && useCORS) {
if(uni.getDeviceInfo().osName === 'ios' && useCORS) {
pathToBase64(image.path).then(base64 => {
image.path = base64
cache[path] = image