diff --git a/src/platforms/app-plus/helpers/get-real-path.js b/src/platforms/app-plus/helpers/get-real-path.js index a3216ae3db8a7e5926a9e1063c1b621e8545b606..483e5b80df456240d8e2d8394d28e1b10089eca6 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 f64c0cfb4ffc17954a39ad4b6ef5aec75c628dea..67bd4a4d91408b83ff7d7f3491ec65049345fb8f 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