fix:提交缺失文件

This commit is contained in:
qian committed 2026-06-09 23:29:22 +08:00
1 parent 8dc9266c14
commit edf5b4530a
1 file changed
+23
+23
View File
@@ -0,0 +1,23 @@
import { ref } from 'vue'
import axios from 'axios'
const siteName = ref('')
let fetched = false
async function fetchSiteName(): Promise<void> {
if (fetched) return
fetched = true
try {
const res = await axios.get('/api/settings/public', { timeout: 5000 })
const settings = res.data?.data?.settings
if (settings?.site_name) {
siteName.value = settings.site_name
}
} catch {
// silent — fallback to default
}
}
export function useSiteName() {
return { siteName, fetchSiteName }
}