提交 e564d7b5 编写于 作者: Q qiang

fix(App): 修复安卓10以上canvas绘制网络图片失败的问题

上级 52702bcd
......@@ -4,10 +4,10 @@
:disable-scroll="disableScroll"
v-on="_listeners"
>
<canvas
ref="canvas"
width="300"
height="150"
<canvas
ref="canvas"
width="300"
height="150"
/>
<div
style="
......@@ -21,9 +21,9 @@
>
<slot />
</div>
<v-uni-resize-sensor
ref="sensor"
@resize="_resize"
<v-uni-resize-sensor
ref="sensor"
@resize="_resize"
/>
</uni-canvas>
</template>
......@@ -311,9 +311,13 @@ export default {
image.ready = true
}
// 安卓 WebView 本地路径
if (__PLATFORM__ === 'app-plus' && navigator.vendor === 'Google Inc.' && src.indexOf('file://') === 0) {
image.crossOrigin = 'anonymous'
// 安卓 WebView 除本地路径无跨域问题
if (__PLATFORM__ === 'app-plus' && navigator.vendor === 'Google Inc.') {
if (src.indexOf('file://') === 0) {
image.crossOrigin = 'anonymous'
}
image.src = src
return
}
getSameOriginUrl(src).then(src => {
image.src = src
......
......@@ -48,6 +48,6 @@ export function getSameOriginUrl (url) {
if (window.webkit && window.webkit.messageHandlers) {
return getBase64(url)
}
return url
return plus.io.convertLocalFileSystemURL(url)
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册