提交 1ee97a65 编写于 作者: Q qiang

fix: 解决H5端uni.getImageInfo获取本地文件信息path错误的问题

上级 04f0825c
import getRealPath from 'uni-platform/helpers/get-real-path'
function _getServiceAddress () { function _getServiceAddress () {
return window.location.protocol + '//' + window.location.host return window.location.protocol + '//' + window.location.host
} }
...@@ -11,7 +9,7 @@ export function getImageInfo ({ ...@@ -11,7 +9,7 @@ export function getImageInfo ({
invokeCallbackHandler: invoke invokeCallbackHandler: invoke
} = UniServiceJSBridge } = UniServiceJSBridge
const img = new Image() const img = new Image()
const realPath = getRealPath(src) const realPath = src
img.onload = function () { img.onload = function () {
invoke(callbackId, { invoke(callbackId, {
errMsg: 'getImageInfo:ok', errMsg: 'getImageInfo:ok',
...@@ -26,4 +24,4 @@ export function getImageInfo ({ ...@@ -26,4 +24,4 @@ export function getImageInfo ({
}) })
} }
img.src = src img.src = src
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册