🔱: [client] sync upgrade with 3 commits [trident-sync]

build: publish success
Merge remote-tracking branch 'origin/main'
pull/91/head
GitHub Actions Bot 2024-07-15 19:23:57 +00:00
parent f230a2a94d
commit f97827ec76
4 changed files with 15 additions and 9 deletions

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.2](https://github.com/fast-crud/fast-crud/compare/v1.21.1...v1.21.2) (2024-07-15)
### Performance Improvements
* 增加示例FsInDrawer ([777830f](https://github.com/fast-crud/fast-crud/commit/777830f860b6a9752ba24df5a99af5e7c62bdfb2))
## [1.21.1](https://github.com/fast-crud/fast-crud/compare/v1.21.0...v1.21.1) (2024-06-23) ## [1.21.1](https://github.com/fast-crud/fast-crud/compare/v1.21.0...v1.21.1) (2024-06-23)
### Bug Fixes ### Bug Fixes

View File

@ -1,6 +1,6 @@
{ {
"name": "@fast-crud/fs-admin-antdv4", "name": "@fast-crud/fs-admin-antdv4",
"version": "1.21.1", "version": "1.21.2",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@ -26,10 +26,10 @@
"@ant-design/icons-vue": "^7.0.1", "@ant-design/icons-vue": "^7.0.1",
"@aws-sdk/client-s3": "^3.535.0", "@aws-sdk/client-s3": "^3.535.0",
"@aws-sdk/s3-request-presigner": "^3.535.0", "@aws-sdk/s3-request-presigner": "^3.535.0",
"@fast-crud/fast-crud": "^1.21.1", "@fast-crud/fast-crud": "^1.21.2",
"@fast-crud/fast-extends": "^1.21.1", "@fast-crud/fast-extends": "^1.21.2",
"@fast-crud/ui-antdv4": "^1.21.1", "@fast-crud/ui-antdv4": "^1.21.2",
"@fast-crud/ui-interface": "^1.21.1", "@fast-crud/ui-interface": "^1.21.2",
"@iconify/vue": "^4.1.1", "@iconify/vue": "^4.1.1",
"@soerenmartius/vue3-clipboard": "^0.1.2", "@soerenmartius/vue3-clipboard": "^0.1.2",
"ant-design-vue": "^4.1.2", "ant-design-vue": "^4.1.2",

View File

@ -181,7 +181,7 @@ function install(app: any, options: any = {}) {
domain: "https://d2p-demo.oss-cn-shenzhen.aliyuncs.com", domain: "https://d2p-demo.oss-cn-shenzhen.aliyuncs.com",
bucket: "d2p-demo", bucket: "d2p-demo",
region: "oss-cn-shenzhen", region: "oss-cn-shenzhen",
accessKeyId: "", accessKeyId: "", //不建议客户端使用AccessKey生产部署请使用getAuthorization来获取授权
accessKeySecret: "", accessKeySecret: "",
async getAuthorization(context: FsUploaderGetAuthContext): Promise<FsUploaderAliossSTS> { async getAuthorization(context: FsUploaderGetAuthContext): Promise<FsUploaderAliossSTS> {
// 不传accessKeySecret代表使用临时签名模式,此时此参数必传(安全,生产环境推荐) // 不传accessKeySecret代表使用临时签名模式,此时此参数必传(安全,生产环境推荐)
@ -239,12 +239,12 @@ function install(app: any, options: any = {}) {
//minio与s3完全适配 //minio与s3完全适配
endpoint: "https://play.min.io", endpoint: "https://play.min.io",
credentials: { credentials: {
//不建议在客户端使用secretAccessKey来上传 //不建议在客户端使用secretAccessKey来上传 生产部署请使用getSignedUrl来获取授权
accessKeyId: "Q3AM3UQ867SPQQA43P2F", //访问登录名 accessKeyId: "Q3AM3UQ867SPQQA43P2F", //访问登录名
secretAccessKey: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" //访问密码 secretAccessKey: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" //访问密码
} }
}, },
//预签名配置,向后端获取上传的预签名连接 //预签名配置,向后端获取上传的预签名连接(生产部署推荐)
async getSignedUrl(bucket: string, key: string, options: any, type: FsUploaderS3SignedUrlType = "put") { async getSignedUrl(bucket: string, key: string, options: any, type: FsUploaderS3SignedUrlType = "put") {
return await GetSignedUrl(bucket, key, type); return await GetSignedUrl(bucket, key, type);
}, },

View File

@ -1,7 +1,7 @@
// @ts-ignore // @ts-ignore
import { S3Client, GetObjectCommand, PutObjectCommand, CreateBucketCommand } from "@aws-sdk/client-s3"; import { S3Client, GetObjectCommand, PutObjectCommand, CreateBucketCommand } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import {utils} from "@fast-crud/fast-crud"; import { utils } from "@fast-crud/fast-crud";
// TODO 模拟server 你应该将此代码搬到你的server端 // TODO 模拟server 你应该将此代码搬到你的server端
let bucketCreated = false; let bucketCreated = false;
export async function generateSignedUrl(bucket: string, key: string, type: "put" | "get" = "get") { export async function generateSignedUrl(bucket: string, key: string, type: "put" | "get" = "get") {