提交 3f4fa4cd 编写于 作者: X xzs02

fix: 解决部分网络路径转换错误的问题

上级 36d5107a
import getRealRoute from 'uni-helpers/get-real-route'
const HTTP_RE = /^(http|https|file):\/\//
const BASE64_IMAGE_RE = /^data:[a-z-]+\/[a-z-]+;base64,/
const SCHEME_RE = /^([a-z-]+:)?\/\//i
const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/
function addBase (filePath) {
if (__uniConfig.router.base) {
......@@ -15,7 +15,7 @@ export default function getRealPath (filePath) {
return addBase(filePath.substr(1))
}
// 网络资源或base64
if (HTTP_RE.test(filePath) || BASE64_IMAGE_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
if (SCHEME_RE.test(filePath) || BASE64_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.
先完成此消息的编辑!
想要评论请 注册