From 86600aba0baacc712b6dbf483ee181138f315def Mon Sep 17 00:00:00 2001 From: zhangxiaoliang25 Date: Mon, 10 Mar 2025 18:49:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9loadLibrary=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangxiaoliang25 Change-Id: Ic8b6978589b13e3daeee32c2319fe0bc78eff1cc --- interfaces/kits/js/src/mod_fs/ani/file_fs_class.ets | 7 +++---- interfaces/kits/js/src/mod_hash/ani/file_hash_class.ets | 5 +++-- .../src/mod_securitylabel/ani/file_securitylabel_class.ets | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/interfaces/kits/js/src/mod_fs/ani/file_fs_class.ets b/interfaces/kits/js/src/mod_fs/ani/file_fs_class.ets index ba52d3112..8b81ef148 100644 --- a/interfaces/kits/js/src/mod_fs/ani/file_fs_class.ets +++ b/interfaces/kits/js/src/mod_fs/ani/file_fs_class.ets @@ -15,9 +15,6 @@ export default fileIo; -loadLibrary("ani_fs_class.z") - - export class BusinessError { code: number = 0; data?: T; @@ -42,7 +39,9 @@ enum AccessFlagType { class fileIo { - + static { + loadLibrary("ani_fs_class.z"); + } static native doAccessSync(path:string, mode?:AccessModeType, flag?:AccessFlagType):boolean; static native unlinkSync(path: string): int; static native mkdirSync(path: string): int; diff --git a/interfaces/kits/js/src/mod_hash/ani/file_hash_class.ets b/interfaces/kits/js/src/mod_hash/ani/file_hash_class.ets index df3cb6995..a39f1841d 100644 --- a/interfaces/kits/js/src/mod_hash/ani/file_hash_class.ets +++ b/interfaces/kits/js/src/mod_hash/ani/file_hash_class.ets @@ -15,8 +15,6 @@ export default hash; -loadLibrary("ani_hash_class.z") - export class BusinessError { code: number = 0; data?: T; @@ -25,6 +23,9 @@ export class BusinessError { export type AsyncCallback = (err: BusinessError, data?: T) => void; class hash { + static { + loadLibrary("ani_hash_class.z"); + } static native hashSync(path: string, algorithm: string): string; // readText promise异步 diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/file_securitylabel_class.ets b/interfaces/kits/js/src/mod_securitylabel/ani/file_securitylabel_class.ets index 0fe339116..3b0183b2a 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/file_securitylabel_class.ets +++ b/interfaces/kits/js/src/mod_securitylabel/ani/file_securitylabel_class.ets @@ -14,9 +14,6 @@ */ export default securitylabel; - -loadLibrary("ani_securitylabel_class.z") - export class BusinessError { code: number = 0; data?: T; @@ -27,6 +24,9 @@ export type AsyncCallback = (err: BusinessError, data?: T) => vo type DataLevel = 's0' | 's1' | 's2' | 's3' | 's4'; class securitylabel { + static { + loadLibrary("ani_securitylabel_class.z"); + } static native setSecurityLabelSync(path: string, type: DataLevel): int; // setSecurityLabel promise异步 -- Gitee