Skip to content

Commit

Permalink
chore: 1
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jul 12, 2024
1 parent b55057c commit 0e03018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/plugins/fast_crud/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function install(app: any, options: any = {}) {
domain: 'https://d2p-demo.oss-cn-shenzhen.aliyuncs.com',
bucket: 'd2p-demo',
region: 'oss-cn-shenzhen',
accessKeyId: '',
accessKeyId: '', //客户端不建议使用此方式
accessKeySecret: '',
async getAuthorization() {
// 不传accessKeySecret代表使用临时签名模式,此时此参数必传(安全,生产环境推荐)
Expand Down Expand Up @@ -232,9 +232,9 @@ function install(app: any, options: any = {}) {
//minio与s3完全适配
endpoint: 'https://play.min.io',
credentials: {
//不建议在客户端使用secretAccessKey来上传
accessKeyId: 'Q3AM3UQ867SPQQA43P2F', //访问登录名
secretAccessKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', //访问密码
//不建议在客户端使用secretAccessKey来上传,生产部署请使用getSignedUrl来获取授权
accessKeyId: '', //访问登录名
secretAccessKey: '', //访问密码
},
},
//预签名配置,向后端获取上传的预签名连接
Expand Down
2 changes: 1 addition & 1 deletion src/views/crud/component/uploader/s3/s3-server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import { S3Client, GetObjectCommand, PutObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';

// TODO 模拟server, 你应该将此代码搬到你的server端
export async function generateSignedUrl(bucket: string, key: string, type: 'put' | 'get' = 'get') {
const client = new S3Client({
// s3ForcePathStyle: true,
Expand Down

0 comments on commit 0e03018

Please sign in to comment.