From 75f671d891f31088d5b22f3dbd473b3a3e726e8d Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 26 Feb 2025 20:55:29 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"feat(system/config):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=98=E5=82=A8=E9=85=8D=E7=BD=AE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d261d4eec5f8ce0989400165fb798369bc5de6a8. --- src/apis/system/index.ts | 1 + src/apis/system/storage.ts | 31 +++ src/apis/system/type.ts | 41 ++- .../{SiteSetting.vue => BasicSetting.vue} | 40 ++- .../system/config/components/MailSetting.vue | 61 +--- .../config/components/SecuritySetting.vue | 75 ++--- .../config/components/StorageSetting.vue | 261 ------------------ src/views/system/config/index.vue | 33 +-- src/views/system/storage/StorageAddDrawer.vue | 198 +++++++++++++ src/views/system/storage/index.vue | 153 ++++++++++ src/views/system/storage/type.ts | 14 + 11 files changed, 491 insertions(+), 417 deletions(-) create mode 100644 src/apis/system/storage.ts rename src/views/system/config/components/{SiteSetting.vue => BasicSetting.vue} (86%) delete mode 100644 src/views/system/config/components/StorageSetting.vue create mode 100644 src/views/system/storage/StorageAddDrawer.vue create mode 100644 src/views/system/storage/index.vue create mode 100644 src/views/system/storage/type.ts diff --git a/src/apis/system/index.ts b/src/apis/system/index.ts index d164d8d..bbf216d 100644 --- a/src/apis/system/index.ts +++ b/src/apis/system/index.ts @@ -5,6 +5,7 @@ export * from './dept' export * from './notice' export * from './dict' export * from './file' +export * from './storage' export * from './option' export * from './user-center' export * from './message' diff --git a/src/apis/system/storage.ts b/src/apis/system/storage.ts new file mode 100644 index 0000000..6336a55 --- /dev/null +++ b/src/apis/system/storage.ts @@ -0,0 +1,31 @@ +import type * as T from './type' +import http from '@/utils/http' + +export type * from './type' + +const BASE_URL = '/system/storage' + +/** @desc 查询存储列表 */ +export function listStorage(query: T.StoragePageQuery) { + return http.get>(`${BASE_URL}`, query) +} + +/** @desc 查询存储详情 */ +export function getStorage(id: string) { + return http.get(`${BASE_URL}/${id}`) +} + +/** @desc 新增存储 */ +export function addStorage(data: any) { + return http.post(`${BASE_URL}`, data) +} + +/** @desc 修改存储 */ +export function updateStorage(data: any, id: string) { + return http.put(`${BASE_URL}/${id}`, data) +} + +/** @desc 删除存储 */ +export function deleteStorage(id: string) { + return http.del(`${BASE_URL}/${id}`) +} diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 0b5c725..c245a58 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -231,6 +231,34 @@ export interface FileQuery { export interface FilePageQuery extends FileQuery, PageQuery { } +/** 存储类型 */ +export interface StorageResp { + id: string + name: string + code: string + type: number + accessKey: string + secretKey: string + endpoint: string + bucketName: string + domain: string + description: string + isDefault: boolean + sort: number + status: number + createUserString: string + createTime: string + updateUserString: string + updateTime: string +} +export interface StorageQuery { + description?: string + status?: number + sort: Array +} +export interface StoragePageQuery extends StorageQuery, PageQuery { +} + /** 客户端类型 */ export interface ClientResp { id: string @@ -306,7 +334,6 @@ export interface SiteConfig { SITE_TITLE: OptionResp SITE_DESCRIPTION: OptionResp SITE_COPYRIGHT: OptionResp - SITE_DOMAIN: OptionResp SITE_BEIAN: OptionResp } @@ -333,18 +360,6 @@ export interface MailConfig { MAIL_SSL_PORT: OptionResp } -/** 存储配置类型 */ -export interface StorageConfig { - STORAGE_DEFAULT: OptionResp - STORAGE_LOCAL_BUCKET: OptionResp - STORAGE_LOCAL_ENDPOINT: OptionResp - STORAGE_OSS_ACCESS_KEY: OptionResp - STORAGE_OSS_SECRET_KEY: OptionResp - STORAGE_OSS_BUCKET: OptionResp - STORAGE_OSS_ENDPOINT: OptionResp - STORAGE_OSS_REGION: OptionResp -} - /** 登录配置类型 */ export interface LoginConfig { LOGIN_CAPTCHA_ENABLED: OptionResp diff --git a/src/views/system/config/components/SiteSetting.vue b/src/views/system/config/components/BasicSetting.vue similarity index 86% rename from src/views/system/config/components/SiteSetting.vue rename to src/views/system/config/components/BasicSetting.vue index 638c32a..6e3ec5e 100644 --- a/src/views/system/config/components/SiteSetting.vue +++ b/src/views/system/config/components/BasicSetting.vue @@ -72,26 +72,24 @@ - - + + - + - - + + - - + + - - - - +