diff --git a/src/views/RetrievewFileView.vue b/src/views/RetrievewFileView.vue index 7f16218..b85e3ea 100644 --- a/src/views/RetrievewFileView.vue +++ b/src/views/RetrievewFileView.vue @@ -295,13 +295,13 @@ const handleSubmit = async () => { inputStatus.value.loading = true try { - const res = await api.post('/share/select/', { + const res = await api.post('share/select/', { code: code.value }) if (res.code === 200) { if (res.detail) { - const isFile = res.detail.text.startsWith('/share/download') || res.detail.name !== 'Text' + const isFile = res.detail.text.startsWith('share/download') || res.detail.name !== 'Text' const newFileData = { id: Date.now(), code: res.detail.code, @@ -368,7 +368,7 @@ const toggleDrawer = () => { } const toSend = () => { - router.push('/send') + router.push('send') } const getQRCodeValue = (record) => { diff --git a/src/views/SendFileView.vue b/src/views/SendFileView.vue index 3ced763..473c17b 100644 --- a/src/views/SendFileView.vue +++ b/src/views/SendFileView.vue @@ -339,7 +339,7 @@ import { import { useRouter } from 'vue-router' import BorderProgressBar from '@/components/common/BorderProgressBar.vue' import QRCode from 'qrcode.vue' -import { useFileDataStore } from '../stores/fileData' +import { useFileDataStore } from '@/stores/fileData' import api from '@/utils/api' import { copyRetrieveLink, copyRetrieveCode, copyWgetCommand } from '@/utils/clipboard' import { getStorageUnit } from '@/utils/convert' @@ -479,7 +479,7 @@ const handleChunkUpload = async (file: File) => { const chunkSize = 5 * 1024 * 1024 const chunks = Math.ceil(file.size / chunkSize) // 1. 初始化切片上传 - const initResponse: any = await api.post('/chunk/upload/init/', { + const initResponse: any = await api.post('chunk/upload/init/', { file_name: file.name, file_size: file.size, chunk_size: chunkSize, @@ -505,7 +505,7 @@ const handleChunkUpload = async (file: File) => { // 使用 application/x-www-form-urlencoded 格式 const chunkResponse: any = await api.post( - `/chunk/upload/chunk/${uploadId}/${i}`, + `chunk/upload/chunk/${uploadId}/${i}`, chunkFormData, { headers: { @@ -526,7 +526,7 @@ const handleChunkUpload = async (file: File) => { } // 3. 完成上传 - const completeResponse: any = await api.post(`/chunk/upload/complete/${uploadId}`, { + const completeResponse: any = await api.post(`chunk/upload/complete/${uploadId}`, { expire_value: expirationValue.value ? parseInt(expirationValue.value) : 1, expire_style: expirationMethod.value }) @@ -561,7 +561,7 @@ const handleDefaultFileUpload = async (file: File) => { formData.append('file', file) formData.append('expire_value', expirationValue.value) formData.append('expire_style', expirationMethod.value) - const response: any = await api.post('/share/file/', formData, config) + const response: any = await api.post('share/file/', formData, config) return response } const checkOpenUpload = () => { @@ -648,7 +648,7 @@ const handleSubmit = async () => { formData.append('text', textContent.value) formData.append('expire_value', expirationValue.value) formData.append('expire_style', expirationMethod.value) - response = await api.post('/share/text/', formData, { + response = await api.post('share/text/', formData, { headers: { 'Content-Type': 'multipart/form-data' } diff --git a/src/views/manage/DashboardView.vue b/src/views/manage/DashboardView.vue index e09d41f..f97c3a1 100644 --- a/src/views/manage/DashboardView.vue +++ b/src/views/manage/DashboardView.vue @@ -182,7 +182,7 @@ const getLocalstorageUsed = (nowUsedBit: string) => { } } const getDashboardData = async () => { - const response: any = await api.get('/admin/dashboard') + const response: any = await api.get('admin/dashboard') dashboardData.totalFiles = response.detail.totalFiles dashboardData.storageUsed = getLocalstorageUsed(response.detail.storageUsed) dashboardData.yesterdaySize = getLocalstorageUsed(response.detail.yesterdaySize) diff --git a/src/views/manage/FileManageView.vue b/src/views/manage/FileManageView.vue index 40962b7..b9c5f39 100644 --- a/src/views/manage/FileManageView.vue +++ b/src/views/manage/FileManageView.vue @@ -459,7 +459,7 @@ const closeEditModal = () => { const handleUpdate = async () => { try { await api({ - url: '/admin/file/update', + url: 'admin/file/update', method: 'patch', data: editForm.value }) @@ -474,7 +474,7 @@ const handleUpdate = async () => { const downloadFile = async (id: number) => { try { const response = await api({ - url: '/admin/file/download', + url: 'admin/file/download', method: 'get', params: { id }, responseType: 'blob' @@ -502,7 +502,7 @@ const downloadFile = async (id: number) => { const deleteFile = async (id: number) => { try { await api({ - url: '/admin/file/delete', + url: 'admin/file/delete', method: 'delete', data: { id } }) diff --git a/src/views/manage/SystemSettingsView.vue b/src/views/manage/SystemSettingsView.vue index d61850b..a79ec86 100644 --- a/src/views/manage/SystemSettingsView.vue +++ b/src/views/manage/SystemSettingsView.vue @@ -102,7 +102,7 @@ const convertToSeconds = (time: number, unit: string): number => { const refreshData = () => { api({ - url: '/admin/config/get', + url: 'admin/config/get', method: 'get' }).then((res: any) => { config.value = res.detail @@ -164,7 +164,7 @@ const submitSave = () => { } api({ - url: '/admin/config/update', + url: 'admin/config/update', method: 'patch', data: formData }).then((res: any) => {