fix: remove /
This commit is contained in:
@@ -295,13 +295,13 @@ const handleSubmit = async () => {
|
|||||||
inputStatus.value.loading = true
|
inputStatus.value.loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.post('/share/select/', {
|
const res = await api.post('share/select/', {
|
||||||
code: code.value
|
code: code.value
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.detail) {
|
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 = {
|
const newFileData = {
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
code: res.detail.code,
|
code: res.detail.code,
|
||||||
@@ -368,7 +368,7 @@ const toggleDrawer = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const toSend = () => {
|
const toSend = () => {
|
||||||
router.push('/send')
|
router.push('send')
|
||||||
}
|
}
|
||||||
|
|
||||||
const getQRCodeValue = (record) => {
|
const getQRCodeValue = (record) => {
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ import {
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import BorderProgressBar from '@/components/common/BorderProgressBar.vue'
|
import BorderProgressBar from '@/components/common/BorderProgressBar.vue'
|
||||||
import QRCode from 'qrcode.vue'
|
import QRCode from 'qrcode.vue'
|
||||||
import { useFileDataStore } from '../stores/fileData'
|
import { useFileDataStore } from '@/stores/fileData'
|
||||||
import api from '@/utils/api'
|
import api from '@/utils/api'
|
||||||
import { copyRetrieveLink, copyRetrieveCode, copyWgetCommand } from '@/utils/clipboard'
|
import { copyRetrieveLink, copyRetrieveCode, copyWgetCommand } from '@/utils/clipboard'
|
||||||
import { getStorageUnit } from '@/utils/convert'
|
import { getStorageUnit } from '@/utils/convert'
|
||||||
@@ -479,7 +479,7 @@ const handleChunkUpload = async (file: File) => {
|
|||||||
const chunkSize = 5 * 1024 * 1024
|
const chunkSize = 5 * 1024 * 1024
|
||||||
const chunks = Math.ceil(file.size / chunkSize)
|
const chunks = Math.ceil(file.size / chunkSize)
|
||||||
// 1. 初始化切片上传
|
// 1. 初始化切片上传
|
||||||
const initResponse: any = await api.post('/chunk/upload/init/', {
|
const initResponse: any = await api.post('chunk/upload/init/', {
|
||||||
file_name: file.name,
|
file_name: file.name,
|
||||||
file_size: file.size,
|
file_size: file.size,
|
||||||
chunk_size: chunkSize,
|
chunk_size: chunkSize,
|
||||||
@@ -505,7 +505,7 @@ const handleChunkUpload = async (file: File) => {
|
|||||||
|
|
||||||
// 使用 application/x-www-form-urlencoded 格式
|
// 使用 application/x-www-form-urlencoded 格式
|
||||||
const chunkResponse: any = await api.post(
|
const chunkResponse: any = await api.post(
|
||||||
`/chunk/upload/chunk/${uploadId}/${i}`,
|
`chunk/upload/chunk/${uploadId}/${i}`,
|
||||||
chunkFormData,
|
chunkFormData,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
@@ -526,7 +526,7 @@ const handleChunkUpload = async (file: File) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 完成上传
|
// 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_value: expirationValue.value ? parseInt(expirationValue.value) : 1,
|
||||||
expire_style: expirationMethod.value
|
expire_style: expirationMethod.value
|
||||||
})
|
})
|
||||||
@@ -561,7 +561,7 @@ const handleDefaultFileUpload = async (file: File) => {
|
|||||||
formData.append('file', file)
|
formData.append('file', file)
|
||||||
formData.append('expire_value', expirationValue.value)
|
formData.append('expire_value', expirationValue.value)
|
||||||
formData.append('expire_style', expirationMethod.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
|
return response
|
||||||
}
|
}
|
||||||
const checkOpenUpload = () => {
|
const checkOpenUpload = () => {
|
||||||
@@ -648,7 +648,7 @@ const handleSubmit = async () => {
|
|||||||
formData.append('text', textContent.value)
|
formData.append('text', textContent.value)
|
||||||
formData.append('expire_value', expirationValue.value)
|
formData.append('expire_value', expirationValue.value)
|
||||||
formData.append('expire_style', expirationMethod.value)
|
formData.append('expire_style', expirationMethod.value)
|
||||||
response = await api.post('/share/text/', formData, {
|
response = await api.post('share/text/', formData, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ const getLocalstorageUsed = (nowUsedBit: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getDashboardData = async () => {
|
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.totalFiles = response.detail.totalFiles
|
||||||
dashboardData.storageUsed = getLocalstorageUsed(response.detail.storageUsed)
|
dashboardData.storageUsed = getLocalstorageUsed(response.detail.storageUsed)
|
||||||
dashboardData.yesterdaySize = getLocalstorageUsed(response.detail.yesterdaySize)
|
dashboardData.yesterdaySize = getLocalstorageUsed(response.detail.yesterdaySize)
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ const closeEditModal = () => {
|
|||||||
const handleUpdate = async () => {
|
const handleUpdate = async () => {
|
||||||
try {
|
try {
|
||||||
await api({
|
await api({
|
||||||
url: '/admin/file/update',
|
url: 'admin/file/update',
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
data: editForm.value
|
data: editForm.value
|
||||||
})
|
})
|
||||||
@@ -474,7 +474,7 @@ const handleUpdate = async () => {
|
|||||||
const downloadFile = async (id: number) => {
|
const downloadFile = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
const response = await api({
|
const response = await api({
|
||||||
url: '/admin/file/download',
|
url: 'admin/file/download',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id },
|
params: { id },
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
@@ -502,7 +502,7 @@ const downloadFile = async (id: number) => {
|
|||||||
const deleteFile = async (id: number) => {
|
const deleteFile = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
await api({
|
await api({
|
||||||
url: '/admin/file/delete',
|
url: 'admin/file/delete',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: { id }
|
data: { id }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const convertToSeconds = (time: number, unit: string): number => {
|
|||||||
|
|
||||||
const refreshData = () => {
|
const refreshData = () => {
|
||||||
api({
|
api({
|
||||||
url: '/admin/config/get',
|
url: 'admin/config/get',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
config.value = res.detail
|
config.value = res.detail
|
||||||
@@ -164,7 +164,7 @@ const submitSave = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
api({
|
api({
|
||||||
url: '/admin/config/update',
|
url: 'admin/config/update',
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
data: formData
|
data: formData
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user