🐛 兼容新旧取件码并完善回收站复制
This commit is contained in:
1 parent
a5c5d1ae3b
commit
b2e1928898
10 files changed
+69
-16
No files matched your search
@@ -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'
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { copyToClipboard as copy } from '@/utils/clipboard'
|
||||
|
||||
export function useClipboard() {
|
||||
const copyToClipboard = (value: string) => copy(value)
|
||||
return { copyToClipboard }
|
||||
}
|
||||
@@ -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 = ''
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user