From facb241b394494fa281c7afedeed5fc554458f00 Mon Sep 17 00:00:00 2001 From: lvyuanyuan Date: Wed, 30 Aug 2023 18:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B7=A8=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=90=8C=E5=90=8D=E6=96=87=E4=BB=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvyuanyuan Change-Id: Iefc8e203489d55a13e2b0e075dd6eb74eff88a31 --- interfaces/innerkits/native/file_uri/src/file_uri.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/innerkits/native/file_uri/src/file_uri.cpp b/interfaces/innerkits/native/file_uri/src/file_uri.cpp index abef75608..5327f19a7 100644 --- a/interfaces/innerkits/native/file_uri/src/file_uri.cpp +++ b/interfaces/innerkits/native/file_uri/src/file_uri.cpp @@ -33,6 +33,7 @@ const std::string MODE_R = "/r/"; const std::string FILE_SCHEME_PREFIX = "file://"; const std::string FILE_MANAGER_AUTHORITY = "docs"; const std::string MEDIA_AUTHORITY = "media"; +const std::string NETWORK_PARA = "?networkid="; string FileUri::GetName() { string sandboxPath = uri_.GetPath(); @@ -67,6 +68,7 @@ string FileUri::GetRealPath() string bundleName = uri_.GetAuthority(); LOGD("GetRealPath decode path is %{private}s", sandboxPath.c_str()); if (bundleName == FILE_MANAGER_AUTHORITY && + uri_.ToString().find(NETWORK_PARA) == string::npos && access(realPath.c_str(), F_OK) == 0) { return realPath; } -- Gitee