- 1.6.5-snapshot
+ 1.6.6-snapshot
2.7.7
diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java
index a2b11b1dc..f554e0b52 100644
--- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java
+++ b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java
@@ -9,10 +9,11 @@ import io.minio.*;
import java.io.ByteArrayInputStream;
import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_ALIYUN;
+import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_TENCENT;
/**
* 基于 S3 协议的文件客户端,实现 MinIO、阿里云、腾讯云、七牛云、华为云等云服务
- *
+ *
* S3 协议的客户端,采用亚马逊提供的 software.amazon.awssdk.s3 库
*
* @author 芋道源码
@@ -78,6 +79,11 @@ public class S3FileClient extends AbstractFileClient {
.replaceAll("-internal", "")// 去除内网 Endpoint 的后缀
.replaceAll("https://", "");
}
+ // 腾讯云必须有 region,否则会报错
+ if (config.getEndpoint().contains(ENDPOINT_TENCENT)) {
+ return StrUtil.subAfter(config.getEndpoint(), ".cos.", false)
+ .replaceAll("." + ENDPOINT_TENCENT, ""); // 去除 Endpoint
+ }
return null;
}
diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java
index 151159f5e..0c46e8aa6 100644
--- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java
+++ b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java
@@ -19,6 +19,7 @@ public class S3FileClientConfig implements FileClientConfig {
public static final String ENDPOINT_QINIU = "qiniucs.com";
public static final String ENDPOINT_ALIYUN = "aliyuncs.com";
+ public static final String ENDPOINT_TENCENT = "myqcloud.com";
/**
* 节点地址
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
index 726a10498..493b5faa6 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
+++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
@@ -75,7 +75,7 @@ public class ConfigController {
if (config == null) {
return null;
}
- if (config.getVisible()) {
+ if (!config.getVisible()) {
throw ServiceExceptionUtil.exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_VISIBLE);
}
return success(config.getValue());
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java
index c4dcfe8a0..2492c803d 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java
+++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java
@@ -1,11 +1,14 @@
package cn.iocoder.yudao.module.infra.dal.mysql.file;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.file.core.client.db.DBFileContentFrameworkDAO;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileContentDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
+import java.util.List;
+import java.util.Optional;
@Repository
public class FileContentDAOImpl implements DBFileContentFrameworkDAO {
@@ -27,9 +30,11 @@ public class FileContentDAOImpl implements DBFileContentFrameworkDAO {
@Override
public byte[] selectContent(Long configId, String path) {
- FileContentDO fileContentDO = fileContentMapper.selectOne(
- buildQuery(configId, path).select(FileContentDO::getContent));
- return fileContentDO != null ? fileContentDO.getContent() : null;
+ List list = fileContentMapper.selectList(
+ buildQuery(configId, path).select(FileContentDO::getContent).orderByDesc(FileContentDO::getId));
+ return Optional.ofNullable(CollUtil.getFirst(list))
+ .map(FileContentDO::getContent)
+ .orElse(null);
}
private LambdaQueryWrapper buildQuery(Long configId, String path) {
diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json
index 42e4ab5ad..803a370b7 100644
--- a/yudao-ui-admin-vue3/package.json
+++ b/yudao-ui-admin-vue3/package.json
@@ -1,6 +1,6 @@
{
"name": "yudao-ui-admin-vue3",
- "version": "1.6.5-snapshot.1901",
+ "version": "1.6.6-snapshot.1901",
"description": "基于vue3、vite4、element-plus、typesScript",
"author": "xingyu",
"private": false,
diff --git a/yudao-ui-admin/package.json b/yudao-ui-admin/package.json
index b59eb5041..0da185829 100644
--- a/yudao-ui-admin/package.json
+++ b/yudao-ui-admin/package.json
@@ -1,6 +1,6 @@
{
"name": "yudao-ui-admin",
- "version": "1.6.5-snapshot",
+ "version": "1.6.6-snapshot",
"description": "芋道管理系统",
"author": "芋道",
"license": "MIT",
diff --git a/yudao-ui-admin/src/views/infra/file/index.vue b/yudao-ui-admin/src/views/infra/file/index.vue
index be76b5c18..bd569a377 100644
--- a/yudao-ui-admin/src/views/infra/file/index.vue
+++ b/yudao-ui-admin/src/views/infra/file/index.vue
@@ -1,14 +1,16 @@
-
+
-
+
搜索
@@ -35,6 +37,9 @@
+
无法预览,点击
下载
@@ -118,7 +123,7 @@ export default {
title: "", // 弹出层标题
isUploading: false, // 是否禁用上传
url: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
- headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
+ headers: {Authorization: "Bearer " + getAccessToken()}, // 设置上传的请求头部
data: {} // 上传的额外数据,用于文件名
},
};
@@ -189,19 +194,20 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
- this.$modal.confirm('是否确认删除文件编号为"' + id + '"的数据项?').then(function() {
+ this.$modal.confirm('是否确认删除文件编号为"' + id + '"的数据项?').then(function () {
return deleteFile(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
+ }).catch(() => {
+ });
},
// 用户昵称展示
sizeFormat(row, column) {
- const unitArr = ["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];
+ const unitArr = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
const srcSize = parseFloat(row.size);
const index = Math.floor(Math.log(srcSize) / Math.log(1024));
- let size =srcSize/Math.pow(1024,index);
+ let size = srcSize / Math.pow(1024, index);
size = size.toFixed(2);//保留的小数位数
return size + ' ' + unitArr[index];
},