Ver Fonte

病理报告图片地址加密

lighter há 1 ano atrás
pai
commit
b158c90a48

+ 1 - 1
src/router/index.js

@@ -160,7 +160,7 @@ export const constantRoutes = [
     meta: { title: '病理报告查询' },
   },
   {
-    path: '/checkPathologyDetail',
+    path: '/checkPathologyDetail/:patientId',
     component: () => import('../views/hospital-service/check-exam/pathology/CheckPathologyDetail.vue'),
     meta: { title: '病理报告详情' },
   },

+ 24 - 1
src/views/hospital-service/check-exam/pathology/CheckPathologyDetail.vue

@@ -1,12 +1,35 @@
 <template>
   <window-size>
-    <van-image width="100%" :src="pathologyIndex.nginxUrl" fit="cover"/>
+    <van-image width="100%" :src="imageSrc" fit="cover"/>
   </window-size>
 </template>
 
 <script setup>
 import {useStore} from "vuex";
+import {onMounted, ref} from "vue";
+import router from "../../../../router";
+import axios from "axios";
+const baseURL = import.meta.env.VITE_BASE_URL
 
 const store = useStore()
 const pathologyIndex = store.getters.getCurrentPathologyIndex
+const imageSrc = ref(null)
+
+onMounted(() => {
+  axios({
+    url: baseURL + '/inspections/checkPathologyDetail',
+    method: 'post',
+    data: {
+      patientId: router.currentRoute.value.params.patientId,
+      reportId: pathologyIndex.reportUrl
+    },
+    headers: {'token': localStorage.getItem('token')},
+    contentType: 'image/JPEG',
+    responseType: 'blob',
+  }).then(response => {
+    const blob = new Blob([response.data],
+        { type: response.headers['content-type'] });
+    imageSrc.value = URL.createObjectURL(blob);
+  })
+})
 </script>

+ 1 - 1
src/views/hospital-service/check-exam/pathology/CheckPathologyIndex.vue

@@ -142,7 +142,7 @@ function handleClickPathologyIndex(item) {
     type: 'storeCurrentPathologyIndex',
     currentPathologyIndex: item
   }).then(() => {
-    router.push('/checkPathologyDetail');
+    router.push('/checkPathologyDetail/' + patientId);
   })
 }