imageKnife header请求头联调图片修改2

Signed-off-by: 张琥珀 <zhanghupo3@h-partners.com>
This commit is contained in:
张琥珀 2024-02-19 18:32:44 +08:00
parent db6396795b
commit 1c59a7a5c9
2 changed files with 4 additions and 6 deletions

View File

@ -61,14 +61,14 @@ export interface DetachFromLayout{
export class RequestOption {
// 遍历添加图片http请求头
map: Map<string, Object> = new Map<string, Object>();
headers: Map<string, Object> = new Map<string, Object>();
// RequestOption调用header对于的方法
addHeader(key: string, value: Object) {
this.map.set(key, value);
this.headers.set(key, value);
}
// 全局调用header对应的方法包含RequestOption的形式
addHeaderMap(map: Map<string, Object>) {
this.map = map;
this.headers = map;
}
uuid:string ='' // 唯一标识

View File

@ -60,12 +60,10 @@ export class HttpDownloadClient implements IDataFetch {
onComplete(combineArray)
})
console.log('refer' + JSON.stringify(request.map.get('refer')))
const headerObj: Record<string, Object> = {}
request.map.forEach((value, key) => {
request.headers.forEach((value, key) => {
headerObj[key] = value
})
console.log('referHeader' + JSON.stringify(headerObj))
httpRequest.requestInStream(
request.loadSrc as string,
{