修改全局请求头覆盖requeset请求头

Signed-off-by: 2206069183@qq.com <2206069183@qq.com>
This commit is contained in:
2206069183@qq.com 2024-04-17 11:10:20 +08:00
parent ab7dd919f3
commit 99b3b34284
1 changed files with 5 additions and 1 deletions

View File

@ -93,7 +93,11 @@ export class RequestOption {
// 全局调用header对应的方法包含RequestOption的形式
addHeaderMap(map: Map<string, Object>) {
this.headers = map;
map.forEach((value, key) => {
if (!this.headers.has(key)) {
this.addHeader(key, value);
}
})
}
// 优先级