From 615fb77d7609fed99d36cabfaa2cb8d52a5860b7 Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 14 Sep 2021 17:16:43 +0800 Subject: [PATCH] fix(App): getRealPath --- src/platforms/app-plus/helpers/get-real-path.js | 2 +- src/platforms/app-plus/service/api/util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/app-plus/helpers/get-real-path.js b/src/platforms/app-plus/helpers/get-real-path.js index a3216ae3d..483e5b80d 100644 --- a/src/platforms/app-plus/helpers/get-real-path.js +++ b/src/platforms/app-plus/helpers/get-real-path.js @@ -25,7 +25,7 @@ export default function getRealPath (filePath) { return 'https:' + filePath } // 平台绝对路径 安卓、iOS - if (filePath.startsWith('/storage/') || filePath.includes('/Containers/Data/Application/')) { + if (filePath.startsWith('/storage/') || filePath.startsWith('/sdcard/') || filePath.includes('/Containers/Data/Application/')) { return 'file://' + filePath } return addBase(filePath.substr(1)) diff --git a/src/platforms/app-plus/service/api/util.js b/src/platforms/app-plus/service/api/util.js index f64c0cfb4..67bd4a4d9 100644 --- a/src/platforms/app-plus/service/api/util.js +++ b/src/platforms/app-plus/service/api/util.js @@ -76,7 +76,7 @@ export function getRealPath (filePath) { // 绝对路径转换为本地文件系统路径 if (filePath.indexOf('/') === 0) { // 平台绝对路径 安卓、iOS - if (filePath.startsWith('/storage/') || filePath.includes('/Containers/Data/Application/')) { + if (filePath.startsWith('/storage/') || filePath.startsWith('/sdcard/') || filePath.includes('/Containers/Data/Application/')) { return 'file://' + filePath } return wwwPath + filePath -- GitLab