feat: 添加存储配置管理功能

- 添加存储配置管理页面(列表、创建、编辑)
- 支持本地存储、S3、WebDAV、FTP、SFTP 等存储类型
- 添加存储配置测试连接功能
- 本地存储自动初始化且禁止删除
- 修复 Switch 组件状态显示问题
- 添加更新存储配置时的 status 字段支持
This commit is contained in:
2026-05-02 17:48:58 +08:00
parent ea8ffb6c74
commit 9b82fbef4e
35 changed files with 5425 additions and 21 deletions
+33 -1
View File
@@ -1,11 +1,12 @@
<script setup lang="ts">
import { computed } from 'vue'
import { computed, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import AdminSidebar from '@/components/admin-sidebar/index.vue'
import LanguageChange from '@/components/language-change.vue'
import ThemePopover from '@/components/custom-theme/theme-popover.vue'
import ToggleTheme from '@/components/toggle-theme.vue'
import api from '@/services/api'
const router = useRouter()
@@ -34,6 +35,10 @@ const breadcrumbs = computed(() => {
'risk-control': '风控管理',
extension: '扩展配置',
profile: '个人中心',
'system-settings': '系统设置',
'payment-channels': '支付渠道',
'email-settings': '邮箱配置',
'storage-configs': '存储管理',
settings: '基本设置',
security: '安全设置',
email: '邮箱设置',
@@ -65,6 +70,33 @@ const breadcrumbs = computed(() => {
return crumbs
})
async function loadSystemSettings() {
const storedSettings = localStorage.getItem('systemSettings')
if (storedSettings) {
return
}
try {
const data = await api.get('/dev/system-settings')
if (data) {
const settings = {
site_name: data.site_name || '',
site_logo: data.site_logo || '',
site_favicon: data.site_favicon || '',
}
localStorage.setItem('systemSettings', JSON.stringify(settings))
window.dispatchEvent(new CustomEvent('system-settings-changed', { detail: settings }))
}
}
catch (error) {
console.error('加载系统设置失败:', error)
}
}
onMounted(() => {
loadSystemSettings()
})
</script>
<template>