feat: 首页title自定义,新增存储路径

This commit is contained in:
Lan
2025-02-08 22:54:15 +08:00
parent 9970906873
commit 6a43e12fc4
3 changed files with 28 additions and 6 deletions
+4 -1
View File
@@ -30,7 +30,7 @@
: 'text-indigo-600'
]"
>
FileCodeBox
{{config.name}}
</h2>
<form @submit.prevent="handleSubmit">
<div class="mb-6 relative">
@@ -388,6 +388,7 @@ const route = useRoute()
// 使用 receiveData 替代原来的 records
const records = receiveData
const config = JSON.parse(localStorage.getItem('config') || '{}')
onMounted(() => {
const query_code = route.query.code
@@ -401,6 +402,8 @@ watch(code, (newVal) => {
}
})
const handleSubmit = async () => {
if (code.value.length !== 5) {
alertStore.showAlert('请输入5位取件码', 'error')
+1 -3
View File
@@ -20,7 +20,7 @@
]"
@click="toRetrieve"
>
FileCodeBox
{{config.name}}
</h2>
<form @submit.prevent="handleSubmit" class="space-y-8">
<!-- 发送类型选择 -->
@@ -416,7 +416,6 @@ import { copyRetrieveLink, copyRetrieveCode } from '@/utils/clipboard'
import { getStorageUnit } from '@/utils/convert'
const config: any = JSON.parse(localStorage.getItem('config') || '{}')
console.log(config)
const router = useRouter()
const isDarkMode = inject('isDarkMode')
@@ -457,7 +456,6 @@ const handleFileDrop = async (event: DragEvent) => {
if (event.dataTransfer?.files && event.dataTransfer.files.length > 0) {
selectedFile.value = event.dataTransfer.files[0]
fileHash.value = await calculateFileHash(selectedFile.value)
startChunkUpload()
}
}
+23 -2
View File
@@ -17,6 +17,7 @@ interface ConfigState {
notify_content: string
openUpload: number
uploadSize: number
storage_path: string
uploadMinute: number
max_save_seconds: number
opacity: number
@@ -48,6 +49,7 @@ const config = ref<ConfigState>({
robotsText: '',
keywords: '',
notify_title: '',
storage_path: '',
notify_content: '',
openUpload: 1,
uploadSize: 1,
@@ -359,14 +361,33 @@ refreshData()
</div>
<!-- 存储设置 -->
<div class="mt-8">
<div class="space-y-4">
<h3
class="text-lg font-medium mb-4"
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
>
存储设置
</h3>
<!-- 通知设置 -->
<div class="space-y-2">
<label
class="block text-sm font-medium"
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-700']"
>
存储路径
</label>
<input
type="text"
placeholder="留空则使用默认路径,可不填写"
v-model="config.storage_path"
class="w-full rounded-md shadow-sm px-4 py-2.5 transition-all duration-200 ease-in-out border focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none"
:class="[
isDarkMode
? 'bg-gray-700 border-gray-600 text-white placeholder-gray-400 hover:border-gray-500'
: 'border-gray-300 hover:border-gray-400 placeholder-gray-500'
]"
/>
</div>
<div class="space-y-4">
<div class="space-y-2">
<label