fix: import axiosClient
This commit is contained in:
parent
37d0b08b11
commit
7749a1ccef
2 changed files with 5 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
import axiosClient from '@/services/HttpService'
|
||||||
|
|
||||||
import type { EhrFile } from '@/stores/tree-data'
|
import type { EhrFile } from '@/stores/tree-data'
|
||||||
import { useFileInfoStore } from '@/stores/file-info-data'
|
import { useFileInfoStore } from '@/stores/file-info-data'
|
||||||
|
|
@ -13,13 +14,9 @@ const { getType, getFormatDate, getSize, getFileNameFormat } = useFileInfoStore(
|
||||||
async function downloadSubmit(path: any) {
|
async function downloadSubmit(path: any) {
|
||||||
const [cabinet, drawer, folder, file] = path.split('/')
|
const [cabinet, drawer, folder, file] = path.split('/')
|
||||||
const formatPath = `/cabinet/${cabinet}/drawer/${drawer}/folder/${folder}/file/${file}`
|
const formatPath = `/cabinet/${cabinet}/drawer/${drawer}/folder/${folder}/file/${file}`
|
||||||
|
const res = await axiosClient.get<EhrFile & { download: string }>(
|
||||||
console.log(formatPath)
|
|
||||||
|
|
||||||
const res = await axios.get<EhrFile & { download: string }>(
|
|
||||||
`${import.meta.env.VITE_API_ENDPOINT}${formatPath}`
|
`${import.meta.env.VITE_API_ENDPOINT}${formatPath}`
|
||||||
)
|
)
|
||||||
console.log(res.data.download)
|
|
||||||
await axios
|
await axios
|
||||||
.get(res.data.download, {
|
.get(res.data.download, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import axios from 'axios'
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
import axiosClient from '@/services/HttpService'
|
||||||
|
|
||||||
import type { EhrFile } from '@/stores/tree-data'
|
import type { EhrFile } from '@/stores/tree-data'
|
||||||
|
|
||||||
import { useSearchDataStore } from '@/stores/searched-data'
|
import { useSearchDataStore } from '@/stores/searched-data'
|
||||||
import { useLoader } from '@/stores/loader'
|
import { useLoader } from '@/stores/loader'
|
||||||
|
|
||||||
import AdvancedSearch from '@/modules/01_user/components/AdvancedSearch.vue'
|
import AdvancedSearch from '@/modules/01_user/components/AdvancedSearch.vue'
|
||||||
|
|
||||||
const loaderStore = useLoader()
|
const loaderStore = useLoader()
|
||||||
|
|
@ -67,7 +67,7 @@ async function searchSubmit() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
loaderStore.show()
|
loaderStore.show()
|
||||||
const res = await axios.post<EhrFile[]>(
|
const res = await axiosClient.post<EhrFile[]>(
|
||||||
`${import.meta.env.VITE_API_ENDPOINT}/search`,
|
`${import.meta.env.VITE_API_ENDPOINT}/search`,
|
||||||
submitSearchData.value
|
submitSearchData.value
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue