diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..0ae1c0f3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: FastGPT 官方文档 + url: https://doc.fastgpt.io/ + about: 查看 FastGPT 官方文档了解更多信息 + - name: FastGPT 飞书交流群 + url: https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png + about: 在社区中讨论 FastGPT 相关问题 + - name: 插件开发指南 + url: https://doc.fastgpt.io/docs/introduction/guide/plugins/dev_system_tool + about: 查看 FastGPT 插件开发指南 diff --git a/.github/ISSUE_TEMPLATE/plugin-request.md b/.github/ISSUE_TEMPLATE/plugin-request.md new file mode 100644 index 00000000..c5d7c678 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/plugin-request.md @@ -0,0 +1,28 @@ +--- +name: 插件需求 +about: 提交 FastGPT 插件需求 +title: '[插件] 简要描述需求' +labels: ['plugin'] +assignees: '' +--- + +## 需求描述 + +需要实现什么插件功能? + +## 使用场景 + +在什么情况下使用这个插件? + +## 输入输出 + +- **输入**: 需要什么参数? +- **输出**: 期望返回什么结果? + +## 参考资料 + +相关文档或 API 接口: + +## 补充说明 + +其他需要说明的信息: \ No newline at end of file diff --git a/lib/s3/controller.ts b/lib/s3/controller.ts index 519cb142..86cf5d06 100644 --- a/lib/s3/controller.ts +++ b/lib/s3/controller.ts @@ -130,7 +130,7 @@ export class S3Service { } private generateFileId(): string { - return randomBytes(16).toString('hex'); + return randomBytes(8).toString('hex'); } /** @@ -248,8 +248,11 @@ export class S3Service { } // const fileId = this.generateFileId(); - const prefix = - (input.prefix?.endsWith('/') ? input.prefix : input.prefix + '/') ?? PluginBaseS3Prefix; + const prefix = input.prefix + ? input.prefix?.endsWith('/') + ? input.prefix + : input.prefix + '/' + : PluginBaseS3Prefix; const objectName = `${prefix}${input.keepRawFilename ? '' : this.generateFileId() + '-'}${originalFilename}`; if (input.expireMins) { await MongoS3TTL.create({