久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

img src 鏈接中的授權(quán)標(biāo)頭

Authorization header in img src link(img src 鏈接中的授權(quán)標(biāo)頭)
本文介紹了img src 鏈接中的授權(quán)標(biāo)頭的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我有一個(gè)使用 jwt 進(jìn)行身份驗(yàn)證的 api.我正在將此 api 用于 vuejs 應(yīng)用程序.我正在嘗試使用

I have an api that uses jwt for authencation. I am using this api for a vuejs app. I am trying to display an image in the app using

<img src="my/api/link" />

但是 api 需要 Authorization 標(biāo)頭,其中包含 jwt token.

But the api expects Authorization header with jwt token in it.

我可以像這樣在瀏覽器請(qǐng)求中添加標(biāo)頭嗎(這里對(duì)幾個(gè)問(wèn)題的回答讓我相信這是不可能的)?

Can I add headers to browser request like this(Answer to few questions here has made me believe it's not possible)?

有什么方法可以解決(使用 js)還是我應(yīng)該更改 api 本身?

Is there any way around it(using js) or should i change the api itself?

推薦答案

img標(biāo)簽中直接用作href的圖片不能進(jìn)行認(rèn)證.如果你真的想對(duì)你的圖像進(jìn)行這種類(lèi)型的身份驗(yàn)證,那么最好使用 ajax 獲取它們,然后嵌入到你的 html 中.

You can not perform authentication on images which are directly used as href in img tag. If you really want this type of authentication on your images, then it's better to fetch them using ajax and then embed in your html.

這篇關(guān)于img src 鏈接中的授權(quán)標(biāo)頭的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Is Math.random() cryptographically secure?(Math.random() 在密碼學(xué)上是安全的嗎?)
Secure random numbers in javascript?(在javascript中保護(hù)隨機(jī)數(shù)?)
How to avoid multiple token refresh requests when making simultaneous API requests with an expired token(使用過(guò)期令牌發(fā)出同時(shí) API 請(qǐng)求時(shí)如何避免多個(gè)令牌刷新請(qǐng)求)
JWT not decoding quot;JWT malformedquot; - Node Angular(JWT 未解碼“JWT malformed;- 節(jié)點(diǎn)角度)
How to invalidate a JWT token with no expiry time(如何使沒(méi)有到期時(shí)間的 JWT 令牌無(wú)效)
How to implement auto refresh in client side(vue.js)?(如何在客戶(hù)端(vue.js)實(shí)現(xiàn)自動(dòng)刷新?)
主站蜘蛛池模板: 欧美一区在线视频 | 天天干夜夜草 | 亚洲午夜一区 | av网址在线 | 日韩毛片视频 | 九九精品在线观看 | 青草视频在线观看免费 | 黄色片毛片 | 亚洲欧美综合 | 国产一区二区在线观看视频 | 午夜精品国产精品大乳美女 | 国产精品国产三级国产 | 亚洲少妇视频 | 国产普通话对白 | 亚洲精品在线免费 | 久久久久久综合 | 黄色综合网 | 男女啪啪网站 | 在线欧美 | 日韩视频一区二区三区 | 中文毛片 | 国产精品国产三级国产aⅴ浪潮 | 精品理论片 | 日本中文字幕视频 | 91青青| 国产人成一区二区三区影院 | 国产视频一区二 | 国产欧美日韩一区 | 亚洲伊人影院 | 日本在线观看网站 | 亚洲一区二区三区在线视频 | 国产成人精品亚洲男人的天堂 | 日韩免费高清 | 狠狠插狠狠操 | 久久精品亚洲 | 成年人免费看视频 | 91精品国产色综合久久不卡98 | 一区二区视频在线 | 国产综合自拍 | 欧美日韩亚洲天堂 | 久草资源在线观看 |