fix: remove /

This commit is contained in:
Lan
2025-03-06 00:25:18 +08:00
parent fb331a9f45
commit 64e8d8c117
5 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -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) => {
+6 -6
View File
@@ -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'
}
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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 }
})
+2 -2
View File
@@ -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) => {