利用iframe下载文件的时候如何给请求头添加东西

vue里面用到iframe下载文件,在调接口的时候报错401,后来经过排查发现请求的时候header少了个东西,现在需要往header加一个东西,但是用了好多方法都没成功,请大神指教。

//js

let url = process.env.BASE_API + '/api/register/download/' + idsString + '?downloadKey='
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url + this.downloadKey
iframe.onload = function () {
        document.body.removeChild(iframe)
}
document.body.appendChild(iframe)


//html
<iframe v-if="ifShowIframe" v-show="false" id="show-iframe"
                                    frameborder=0 name="showHere" scrolling=auto
                            :src="iframeSrc"></iframe>

你好,你的问题解决了吗

你的问题解决了吗

排队提问,你的问题解决了吗

所以解决了吗?

所以解决了吗

up主您好请问解决了吗??