提交 671d9a3d 编写于 作者: X xiaoyucoding

fix: 修复无协议的图片资源无法加载的问题

上级 d214c5c1
......@@ -12,7 +12,11 @@ function addBase (filePath) {
export default function getRealPath (filePath) {
if (filePath.indexOf('/') === 0) {
return addBase(filePath.substr(1))
if (filePath.indexOf('//') === 0) {
filePath = 'https:' + filePath
} else {
return addBase(filePath.substr(1))
}
}
// 网络资源或base64
if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
......@@ -25,4 +29,4 @@ export default function getRealPath (filePath) {
}
return filePath
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册