3 COS配置项记录
Pan Qiancheng edited this page 2025-10-16 17:25:13 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

在系统中使用S3配置OSS参考如下

            Cos: {
                s3: {
                    accessKey: "admin",
                    // 指定endpoint用于S3兼容服务若使用AWS S3则无需指定
                   endpoint: 'ip:9000',
                    buckets: [
                        {
                            zone: 'admin',
                            name: 'test-admin',
                            domain: 'ip:9000',
                            protocol: 'http:',

                            // 若使用 MinIO必须开启pathStyle
                            pathStyle: true,
                        },
                    ],
                    defaultBucket: 'test',
                }
            },
            Account: {
                s3: [
                    {
                        accessKey: "admin",
                        secretKey: "admin",
                    }
                ]
            },

然后需要在上传组件中指定origin={"s3"}