vuejs 썸네일형 리스트형 Add authorization header in ajax with axios Add authorization header in ajax process. const token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MvXC9yZW5ld9fQ.hGyUlcvaRfLhiaaQAqQg'; const authorization = `JWT ${token}`; axios.defaults.headers.common["authorization"] = authorization; const authCodeResult = await axios.post() 더보기 Force file download Force download with axios on vue.js fileDownload = (url, method, req, fileName) => { const axiosConfig = { method: method, url: url, responseType: 'blob', params: req, }; try { const response = await axios(axiosConfig); const url = window.URL.createObjectURL(new Blob([response.data])); const anchor = document.createElement('a'); anchor.href = url; anchor.setAttribute('download', fileName); docum.. 더보기 이전 1 다음