Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从数据库动态配置,上传提示:没有找到对应的存储平台 #87

Closed
YOHN89 opened this issue Jun 27, 2023 · 3 comments
Closed

Comments

@YOHN89
Copy link

YOHN89 commented Jun 27, 2023

由于业务需求关系,不能将云存储的配置信息写死在l配置文件中,需要从数据库中读取配置信息然后动态配置。根据文档用以下代码测试,返回提示:没有找到对应的存储平台。相关代码如下:

                // 默认使用七牛云
                QiniuKodoFileStorage storage = new QiniuKodoFileStorage();
                storage.setPlatform("qiniu-oss-1");
                storage.setBasePath("demo/");
                storage.setDomain(platform.getDomain());
                storage.setBucketName(platform.getBucketName());
                storage.setAccessKey(platform.getAk());
                storage.setAccessKey(platform.getSk());
                list.add(storage);
                log.info("---------------------- the list ---------------------- {}", list);
                FileInfo fileInfo =  fileStorageService.of(file)
                .setPlatform("qiniu-kodo-1")    // 使用指定的存储平台
                .upload();
                R.ok(fileInfo);
@1171736840
Copy link
Collaborator

1171736840 commented Jun 27, 2023

storage.setPlatform("qiniu-oss-1");

.setPlatform("qiniu-kodo-1") // 使用指定的存储平台

这两个不一样

@YOHN89
Copy link
Author

YOHN89 commented Jun 27, 2023

大意了,已解决!

@YOHN89 YOHN89 closed this as completed Jun 27, 2023
@1171736840
Copy link
Collaborator

还有一个问题
storage.setAccessKey(platform.getAk());
storage.setAccessKey(platform.getSk());
这两个一样的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants