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

Merge branch 'fix-base64-svg' into dev

......@@ -344,7 +344,7 @@ export default {
if (window.plus && src.indexOf('http://') !== 0 && src.indexOf('https://') !==
0) {
loadFile(src)
} else if (/^data:[a-z-]+\/[a-z-]+;base64,/.test(src)) {
} else if (/^data:.*,.*/.test(src)) {
sefl._images[src].src = src
} else {
loadUrl(src)
......
import getRealRoute from 'uni-helpers/get-real-route'
const SCHEME_RE = /^([a-z-]+:)?\/\//i
const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/
const DATA_RE = /^data:.*,.*/
function addBase (filePath) {
return filePath
......@@ -16,7 +16,7 @@ export default function getRealPath (filePath) {
}
}
// 网络资源或base64
if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
return filePath
}
......
......@@ -44,7 +44,7 @@ const _handleLocalPath = filePath => {
export function getRealPath (filePath) {
const SCHEME_RE = /^([a-z-]+:)?\/\//i
const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/
const DATA_RE = /^data:.*,.*/
// 无协议的情况补全 https
if (filePath.indexOf('//') === 0) {
......@@ -52,7 +52,7 @@ export function getRealPath (filePath) {
}
// 网络资源或base64
if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath)) {
if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath)) {
return filePath
}
......
import getRealRoute from 'uni-helpers/get-real-route'
const SCHEME_RE = /^([a-z-]+:)?\/\//i
const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/
const DATA_RE = /^data:.*,.*/
function addBase (filePath) {
if (__uniConfig.router.base) {
......@@ -19,7 +19,7 @@ export default function getRealPath (filePath) {
}
}
// 网络资源或base64
if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
return filePath
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册