diff --git a/images/image-1.png b/images/image-1.png
new file mode 100644
index 0000000..dd22ca1
Binary files /dev/null and b/images/image-1.png differ
diff --git a/images/image-2.png b/images/image-2.png
new file mode 100644
index 0000000..80a2f0e
Binary files /dev/null and b/images/image-2.png differ
diff --git a/images/image-3.png b/images/image-3.png
new file mode 100644
index 0000000..a10ed94
Binary files /dev/null and b/images/image-3.png differ
diff --git a/images/image.png b/images/image.png
new file mode 100644
index 0000000..e31bcb0
Binary files /dev/null and b/images/image.png differ
diff --git a/upload-file-frontend/src/utils/api.js b/upload-file-frontend/src/utils/api.js
index 6523f19..b77d31f 100644
--- a/upload-file-frontend/src/utils/api.js
+++ b/upload-file-frontend/src/utils/api.js
@@ -126,6 +126,40 @@ const pageFiles = ({ page = 1, pageSize = 10, storageType, fileName }) => {
});
};
+/**
+ * 根据存储类型获取存储配置
+ * @param {Object} params 参数对象
+ * @param {string} params.type 类型
+ * @returns
+ */
+const getStorageConfig = ({ type}) => {
+ return http.get('/config', {
+ params: { type }
+ });
+};
+
+/**
+ * 修改存储配置
+ * @param {Object} params 参数对象
+ * @param {number} params.id id
+ * @param {string} params.type 类型
+ * @param {string} params.endpoint endpoint
+ * @param {string} params.accessKey accessKey
+ * @param {string} params.secretKey secretKey
+ * @param {string} params.bucket bucket
+ * @returns
+ */
+const setStorageConfig = ({ id, type, endpoint, accessKey, secretKey, bucket }) => {
+ return http.patch('/config', {
+ id,
+ type,
+ endpoint,
+ accessKey,
+ secretKey,
+ bucket
+ });
+}
+
export {
getUploadProgress,
createMultipartUpload,
@@ -134,5 +168,7 @@ export {
uploadFile,
uploadPart,
pageFiles,
+ getStorageConfig,
+ setStorageConfig,
httpExtra
};
diff --git a/upload-file-frontend/src/views/FileUpload.vue b/upload-file-frontend/src/views/FileUpload.vue
index 81a8d2a..16c755c 100644
--- a/upload-file-frontend/src/views/FileUpload.vue
+++ b/upload-file-frontend/src/views/FileUpload.vue
@@ -10,7 +10,8 @@
@@ -52,7 +53,8 @@
-
+
🖼️ 暂无已上传的文件
@@ -63,7 +65,8 @@
-
![]()
+
📄
@@ -118,13 +121,53 @@
✖
+
+
+
+
+
存储系统配置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -302,8 +429,10 @@ export default {
.image-preview-content {
position: relative;
- width: 90vw; /* 视口宽度的90% */
- height: 90vh; /* 视口高度的90% */
+ width: 90vw;
+ /* 视口宽度的90% */
+ height: 90vh;
+ /* 视口高度的90% */
display: flex;
justify-content: center;
align-items: center;
@@ -314,7 +443,8 @@ export default {
max-height: 100%;
width: auto;
height: auto;
- object-fit: contain; /* 保持图片比例,完整显示 */
+ object-fit: contain;
+ /* 保持图片比例,完整显示 */
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
@@ -778,4 +908,171 @@ export default {
padding: 10px 16px;
}
}
+
+/* 存储配置弹窗样式优化 */
+.storage-config-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(25, 118, 210, 0.2);
+ /* 使用主题色透明背景 */
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 1000;
+ backdrop-filter: blur(2px);
+ /* 背景模糊效果 */
+ animation: modal-fade 0.3s ease-out;
+}
+
+.storage-config-content {
+ background: #ffffff;
+ padding: 2rem;
+ border-radius: 12px;
+ width: 480px;
+ box-shadow: 0 8px 32px rgba(25, 118, 210, 0.15);
+ transform-origin: center;
+ animation: modal-scale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
+}
+
+.storage-config-content h2 {
+ color: #1976d2;
+ font-size: 1.5rem;
+ margin: 0 0 2rem;
+ text-align: center;
+ position: relative;
+ padding-bottom: 0.5rem;
+}
+
+.storage-config-content h2::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 40px;
+ height: 3px;
+ background: rgba(25, 118, 210, 0.2);
+ border-radius: 2px;
+}
+
+/* 表单元素优化 */
+.form-group {
+ margin-bottom: 1.5rem;
+ position: relative;
+}
+
+.form-group label {
+ display: block;
+ margin-bottom: 0.5rem;
+ font-size: 0.9rem;
+ color: #4a5568;
+ font-weight: 500;
+}
+
+.form-group input,
+.form-group select {
+ width: 93%;
+ padding: 0.75rem 1rem;
+ border: 1px solid #cbd5e0;
+ border-radius: 8px;
+ font-size: 0.95rem;
+ transition: all 0.2s ease;
+ background: #f8fafc;
+}
+
+.form-group input:focus,
+.form-group select:focus {
+ border-color: #1976d2;
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
+ background: #ffffff;
+ outline: none;
+}
+
+.form-group select {
+ appearance: none;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-6 w-6' fill='none' viewBox='0 0 24 24' stroke='%234a5568'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ background-position: right 1rem center;
+ background-size: 1.2em;
+}
+
+/* 操作按钮区域 */
+.form-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 12px;
+ margin-top: 24px;
+ /* 与表单内容分隔 */
+}
+
+/* 按钮样式 */
+.form-actions button {
+ padding: 10px 20px;
+ border: none;
+ border-radius: 6px;
+ cursor: pointer;
+ font-size: 14px;
+ font-weight: 500;
+ transition: all 0.2s ease;
+}
+
+/* 保存按钮 */
+.form-actions button:first-child {
+ background: #1976d2;
+ color: white;
+ box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
+}
+
+.form-actions button:first-child:hover {
+ background: #1565c0;
+ box-shadow: 0 4px 10px rgba(25, 118, 210, 0.4);
+}
+
+/* 取消按钮 */
+.form-actions button:last-child {
+ background: #f0f7ff;
+ color: #1976d2;
+ border: 1px solid #d0e4fc;
+}
+
+.form-actions button:last-child:hover {
+ background: #e3f2fd;
+ border-color: #1976d2;
+}
+
+/* 动画效果 */
+@keyframes modal-fade {
+ from {
+ opacity: 0;
+ }
+
+ to {
+ opacity: 1;
+ }
+}
+
+@keyframes modal-scale {
+ from {
+ transform: scale(0.95);
+ }
+
+ to {
+ transform: scale(1);
+ }
+}
+
+/* 响应式调整 */
+@media (max-width: 640px) {
+ .storage-config-content {
+ width: 90%;
+ padding: 1.5rem;
+ }
+
+ .form-actions {
+ flex-direction: column;
+ }
+}
\ No newline at end of file