vue + springboot點(diǎn)擊按鈕實(shí)現(xiàn)網(wǎng)絡(luò)資源下載

前端代碼?
<template>
? ? ?<el-button size="mini" type="success" @click="download(scope.row.id)">
? ? ? ? ? ?下載
? ? ? ? ? </el-button>
</template>
調(diào)用的函數(shù),可自行根據(jù)情況修改
后端代碼
使用的還是Java JDK里的url方法去獲取的數(shù)據(jù)流.........
如果有知道更便捷庫(kù)類的大神歡迎評(píng)論!
當(dāng)前端訪問(wèn)該接口時(shí)將會(huì)在瀏覽器當(dāng)中下載后端所請(qǐng)求的文件