🐛 兼容新旧取件码并完善回收站复制

This commit is contained in:
orion committed 2026-09-11 08:59:34 +08:00
1 parent a5c5d1ae3b
commit b2e1928898
10 files changed
+69 -16

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ export { useAdminSession } from './useAdminSession'
export { useAppShell } from './useAppShell'
export { useDashboardStats } from './useDashboardStats'
export { useInjectedDarkMode } from './useInjectedDarkMode'
export { useClipboard } from './useClipboard'
export { usePresignedUpload } from './usePresignedUpload'
export { usePublicConfigBootstrap } from './usePublicConfigBootstrap'
export { useRetrieveFlow } from './useRetrieveFlow'
+6
View File
@@ -0,0 +1,6 @@
import { copyToClipboard as copy } from '@/utils/clipboard'
export function useClipboard() {
const copyToClipboard = (value: string) => copy(value)
return { copyToClipboard }
}
+3 -2
View File
@@ -9,6 +9,7 @@ import { copyToClipboard } from '@/utils/clipboard'
import { getErrorMessage } from '@/utils/common'
import { renderMarkdownPreview } from '@/utils/content-preview'
import { downloadReceivedRecord } from '@/utils/download-action'
import { isValidRetrievalCode } from '@/utils/retrieval-code'
type InputStatus = {
readonly: boolean
@@ -36,7 +37,7 @@ export function useRetrieveFlow() {
const renderedContent = ref('')
const normalizedCode = computed(() => code.value.trim())
const isWorking = computed(() => isInspecting.value || isRetrieving.value)
const hasValidCode = computed(() => normalizedCode.value.length === 5)
const hasValidCode = computed(() => isValidRetrievalCode(normalizedCode.value))
const formatFileSize = (bytes: number) => {
if (bytes === 0) return '0 ' + t('fileSize.bytes')
@@ -214,7 +215,7 @@ export function useRetrieveFlow() {
resetInspection()
}
if (nextCode.length < 5 && error.value) {
if (!isValidRetrievalCode(nextCode) && error.value) {
error.value = ''
}
})