提交 e564d7b5 编写于 作者: Q qiang

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

上级 52702bcd
......@@ -311,10 +311,14 @@ export default {
image.ready = true
}
// 安卓 WebView 本地路径
if (__PLATFORM__ === 'app-plus' && navigator.vendor === 'Google Inc.' && src.indexOf('file://') === 0) {
// 安卓 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
}).catch(() => {
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册