natasha пре 1 година
родитељ
комит
1a323f0285

+ 1 - 1
src/components/common/BookPeruseCard.vue

@@ -116,7 +116,7 @@ export default {
     handleLink(){
         let url  = this.LoginNavIndex +'&&&1&&&2&&&3&&&' + this.previousPage
         this.$router.push({
-            path: "/bookItem",
+            path: "/articlePeruseDetail",
             query: {
                 headerConfig: encodeURIComponent(url),
                 isBuy:this.isBuy,

+ 15 - 22
src/views/bookShelf/components/ResourcesList.vue

@@ -18,6 +18,7 @@
 <script>
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
+import { getToken } from '@/utils/auth'
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { },
@@ -77,28 +78,20 @@ export default {
     },
     // 下载图片
     handleDownloadPic(item){
-        // getLogin('/FileServer/GetFileInfo', {
-        //     file_id: item.file_id
-        // })
-        // .then((res) => {
-        //     if(res.status===1){
-        //         Axios({
-        //             method: 'get',
-        //             url: res.file_url,
-        //             responseType: 'blob'
-        //         }).then((res)=>{
-        //             let bloburl = window.URL.createObjectURL(res.data)
-        //             let link = document.createElement(a)
-        //             document.body.appendChild(link)
-        //             link.style.display = 'none'
-        //             link.href = bloburl
-        //             link.download = item.file_name
-        //             link.click()
-        //             document.body.removeChild(link)
-        //             window.URL.revokeObjectURL(bloburl)
-        //         })
-        //     }
-        // })
+        let userInfor = getToken();
+        let access_token = "";
+        if (userInfor) {
+            let user = JSON.parse(getToken());
+            access_token = user.access_token;
+        }
+        let FileID = item.file_id
+        let data = {
+            access_token,
+            FileID
+        };
+        let href = process.env.VUE_APP_BASE_API +
+            `/FileServer/WebFileDownload?AccessToken=${data.access_token}&FileID=${data.FileID}`;
+        window.open(href)
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)