Compare commits

..

3 Commits

Author SHA1 Message Date
zgf 04e2d430f2 修改CHANGELOG版本号
Signed-off-by: zgf <zenggaofeng2@h-partners.com>
2024-11-01 16:38:49 +08:00
jinzhao 80ba246aeb 删除对constructor的修改
Signed-off-by: jinzhao <jinzhao@kaihong.com>
2024-11-01 07:44:21 +00:00
jinzhao c75bb9226a 新增https自定义证书功能
Signed-off-by: jinzhao <jinzhao@kaihong.com>
2024-11-01 07:44:21 +00:00
7 changed files with 18 additions and 4 deletions

View File

@ -1,6 +1,9 @@
## 3.2.0-rc.1
## 3.2.0-rc.2
- Added callback information for image loading
- Added the interface for obtaining the upper limit and size of the current cache and the number of images corresponding to the current cache
- HTTPS custom certificate verification
## 3.2.0-rc.1
- Change the queue from Stack to Queue
- ShowPixelMap callback PixelMap assigns value to Image component to synchronize

View File

@ -76,7 +76,9 @@ struct SingleImage {
placeholderSrc: $r("app.media.loading"),
errorholderSrc: $r("app.media.failed"),
objectFit: ImageFit.Contain,
progressListener:(progress:number)=>{console.info("ImageKnife:: call back progress = " + progress)}
progressListener:(progress:number)=>{console.info("ImageKnife:: call back progress = " + progress)},
// 通过https协议进行连接时默认使用系统预设CA证书。若希望使用自定义证书进行https连接则需要将自定义证书上传至应用沙箱目录中并在caPath中指定该证书所在的应用沙箱路径
// caPath: "/data/storage/el1/bundle/ca.pem",
}
}).width(100).height(100)
Text($r('app.string.Custom_network_download'))

View File

@ -14,7 +14,7 @@
"main": "index.ets",
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
"type": "module",
"version": "3.2.0-rc.1",
"version": "3.2.0-rc.2",
"dependencies": {
"@ohos/gpu_transform": "^1.0.2"
},

View File

@ -254,7 +254,8 @@ export class ImageKnifeDispatcher {
fileCacheFolder: ImageKnife.getInstance().getFileCache()?.getCacheFolder(),
isAnimator:isAnimator,
moduleName: moduleName == "" ? undefined : moduleName,
resName: resName == "" ? undefined : resName
resName: resName == "" ? undefined : resName,
caPath: currentRequest.imageKnifeOption.caPath,
}
if(request.customGetImage == undefined) {

View File

@ -454,6 +454,7 @@ export class ImageKnifeLoader {
readTimeout: 0,
// usingProtocol:http.HttpProtocol.HTTP1_1
// header: new Header('application/json')
caPath: request.caPath === undefined ? undefined : request.caPath,
});
promise.then((data: number) => {

View File

@ -146,5 +146,6 @@ export interface RequestJobRequest {
isAnimator?: boolean,
moduleName?:string,
resName?: string
caPath?: string,
}

View File

@ -44,6 +44,10 @@ export class AnimatorOption {
onRepeat?:()=>void
}
interface ImageOption {
// 自定义证书路径
caPath?: string,
}
@Observed
export class ImageKnifeOption {
// 主图资源
@ -74,6 +78,8 @@ export class ImageKnifeOption {
onLoadListener?: OnLoadCallBack | undefined;
onComplete?:(event:EventImage | undefined) => void
drawingColorFilter?: ColorFilter | drawing.ColorFilter
// 自定义证书路径
caPath?: string
constructor() {
}