wx.getImageInfo 本地图可以 网络图片报错为什么?

小程序 文章 2022-03-09 18:40 0 全屏看文

wx.getImageInfo 本地图可以 网络图片报错为什么?wx.getImageInfo This map can be used for network images Why is the error reported?

wx.getImageInfo 本地图可以 网络图片报错为什么?

网络图片报错信息 "getImageInfo:fail download image fail. reason: downloadFile:fail Error: ENOENT: no such file or directory, open ....

网络域名url添加到了downloadFile里了,况且我也没有勾选校验域名,图片网址可以访问到

wx.getImageInfo({

        src:"https://****/images/img1.jpg",

        success (res) {

          console.log(res);

          self.setData({

            width:res.width,

            ytheightimg:res.height,


          })

        },

        fail(err) {

          console.log(err)

        },

d image fail. reason: downloadFile:fail Error: ENOENT: no such file or directory, open 'C:UsersAdministratorAppDataLocal微信开发者工具User Data4ec2a556ea7781d86bd6e9eee09f452fWeappSimulatorWeappFileSystemo6zAJs6VEXTWuNuy771wJxIT98YMwx53ba2293ba2e9c1ftmpqXSespeVJ16x6fec88412eedd2023dd9218c1fde9440.jpg'" "getImageInfo:fail download image fail. reason: downloadFile:fail Error: ENOENT: no such file or directory, open 'C:UsersAdministratorAppDataLocal微信开发者工具User Data4ec2a556ea7781d86bd6e9eee09f452fWeappSimulatorWeappFileSystemo6zAJs6VEXTWuNuy771wJxIT98YMwx53ba2293ba2e9c1ftmpqXSespeVJ16x6fec88412eedd2023dd9218c1fde9440.jpg'"

网络图片报错信息 "getImageInfo:fail download image fail. reason: downloadFile:fail Error: ENOENT: no such file or directory, open .... 网络域名url添加到了downloadFile里了,况且我也没有勾选校验域名,图片网址可以访问到 wx.getImageInfo({ src:"https://****/images/img1.jpg", success (res) { console.log(res); self.setData({ width:res.width, ytheightimg:res.height, }) }, fail(err) { console.log(err) }, d image fail. reason: downloadFile:fail Error: ENOENT: no such file or directory, open 'C:UsersAdministratorAppDataLocal微信开发者工具User Data4ec2a556ea7781d86bd6e9eee09f452fWeappSimulatorWeappFileSystemo6zAJs6VEXTWuNuy771wJxIT98YMwx53ba2293ba2e9c1ftmpqXSespeVJ16x6fec88412eedd2023dd9218c1fde9440.jpg'" "getImageInfo:fail download image fail. reason: downloadFile:fail Error: ENOENT: no such file or directory, open 'C:UsersAdministratorAppDataLocal微信开发者工具User Data4ec2a556ea7781d86bd6e9eee09f452fWeappSimulatorWeappFileSystemo6zAJs6VEXTWuNuy771wJxIT98YMwx53ba2293ba2e9c1ftmpqXSespeVJ16x6fec88412eedd2023dd9218c1fde9440.jpg'"

回答:

八九:

刚加嘛。开发工具>项目配置>刷新下域名信息.再试

紫筱姣姣:域名配置一直都有,wx.getImageInfo是域名配置后才用用到的
王一鸣:

你猜

微喵网络:

图片网址发出来看看

-EOF-