parent
a27ca5b4c7
commit
4f549b2f81
|
@ -4,6 +4,7 @@
|
||||||
- ImageKnife控制可视化区域图片
|
- ImageKnife控制可视化区域图片
|
||||||
- 修复占位图、错误图、重试图从内存获取之后进入子线程导致内存泄露
|
- 修复占位图、错误图、重试图从内存获取之后进入子线程导致内存泄露
|
||||||
- ImageKnifeComponent组件key属性改为id属性
|
- ImageKnifeComponent组件key属性改为id属性
|
||||||
|
- 修改header图的存储标志位
|
||||||
|
|
||||||
## 2.2.0-rc.1
|
## 2.2.0-rc.1
|
||||||
- 修改ImageKnife跳过网络,点击默认,图片没有传入宽高,无显示bug
|
- 修改ImageKnife跳过网络,点击默认,图片没有传入宽高,无显示bug
|
||||||
|
|
|
@ -56,6 +56,7 @@ struct testImageKnifeHttpRequestHeader {
|
||||||
loadSrc: 'http://1.94.37.200:7070/AntiTheftChain/downloadImage',
|
loadSrc: 'http://1.94.37.200:7070/AntiTheftChain/downloadImage',
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
signature: new ObjectKey('refer11'),
|
||||||
headerOption: [this.headerOptions1]
|
headerOption: [this.headerOptions1]
|
||||||
};
|
};
|
||||||
@State imageKnifeOption2: ImageKnifeOption =
|
@State imageKnifeOption2: ImageKnifeOption =
|
||||||
|
@ -63,6 +64,7 @@ struct testImageKnifeHttpRequestHeader {
|
||||||
loadSrc: 'http://1.94.37.200:7070/AntiTheftChain/downloadImage',
|
loadSrc: 'http://1.94.37.200:7070/AntiTheftChain/downloadImage',
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
signature: new ObjectKey('xx22'),
|
||||||
headerOption: [this.headerOptions2]
|
headerOption: [this.headerOptions2]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,13 +72,16 @@ struct testImageKnifeHttpRequestHeader {
|
||||||
load(src: string | image.PixelMap | Resource, type: string, num: number) {
|
load(src: string | image.PixelMap | Resource, type: string, num: number) {
|
||||||
clearTimeout(timeId)
|
clearTimeout(timeId)
|
||||||
let request = new RequestOption()
|
let request = new RequestOption()
|
||||||
|
let key: string | null = ''
|
||||||
if (type == 'error') {
|
if (type == 'error') {
|
||||||
request.addHeader('xx', src)
|
key = 'xx'
|
||||||
} else {
|
} else {
|
||||||
request.addHeader('refer', src)
|
key = 'refer'
|
||||||
}
|
}
|
||||||
|
request.addHeader(key, src)
|
||||||
//清理缓存
|
//清理缓存
|
||||||
request.signature = new ObjectKey(new Date().getTime().toString())
|
request.signature = new ObjectKey(key + num)
|
||||||
|
key = null
|
||||||
request.load(src)
|
request.load(src)
|
||||||
.addListener({ callback: (err: BusinessError | string, data: ImageKnifeData) => {
|
.addListener({ callback: (err: BusinessError | string, data: ImageKnifeData) => {
|
||||||
if (data.isPixelMap()) {
|
if (data.isPixelMap()) {
|
||||||
|
|
|
@ -267,7 +267,6 @@ export struct ImageKnifeComponent {
|
||||||
for (let i = 0; i < this.imageKnifeOption.headerOption.length; i++) {
|
for (let i = 0; i < this.imageKnifeOption.headerOption.length; i++) {
|
||||||
let headerOptions = this.imageKnifeOption.headerOption[i];
|
let headerOptions = this.imageKnifeOption.headerOption[i];
|
||||||
request.addHeader(headerOptions.key, headerOptions.value);
|
request.addHeader(headerOptions.key, headerOptions.value);
|
||||||
request.signature = new ObjectKey(new Date().getTime().toString())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( this.imageKnifeOption.priority != undefined) {
|
if( this.imageKnifeOption.priority != undefined) {
|
||||||
|
|
Loading…
Reference in New Issue