Skip to content

Commit

Permalink
perf: alioss getAuthorization接口支持后台返回key
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jun 7, 2024
1 parent 2cd04f2 commit 89c6fc6
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions src/views/crud/component/uploader/form/crud.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import * as api from "./api";
import {
AddReq,
CreateCrudOptionsProps,
CreateCrudOptionsRet,
DelReq,
EditReq,
UserPageQuery,
UserPageRes,
utils
} from "@fast-crud/fast-crud";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
import { createUploaderRules } from "@fast-crud/fast-extends";

export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
Expand Down Expand Up @@ -166,20 +157,14 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
valueType: "key",
async buildUrl(value: any) {
return new Promise((resolve) => {
const url = "http://www.docmirror.cn:7070/api/upload/form/download?key=" + value;
resolve(url);
});
return "http://www.docmirror.cn:7070/api/upload/form/download?key=" + value;
}
}
},
column: {
component: {
async buildUrl(value: any) {
return new Promise((resolve) => {
const url = "http://www.docmirror.cn:7070/api/upload/form/download?key=" + value;
resolve(url);
});
return "http://www.docmirror.cn:7070/api/upload/form/download?key=" + value;
}
}
}
Expand All @@ -204,24 +189,19 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
valueType: "fileId",
async buildUrls(value: any[]) {
//批量构建url
return new Promise((resolve) => {
const urls: string[] = [];
for (const item of value) {
const url = "http://www.docmirror.cn:7070/api/upload/form/download?key=" + item;
urls.push(url);
}
resolve(urls);
});
const urls: string[] = [];
for (const item of value) {
const url = "http://www.docmirror.cn:7070/api/upload/form/download?key=" + item;
urls.push(url);
}
return urls;
}
}
},
column: {
component: {
async buildUrl(value: any) {
return new Promise((resolve) => {
const url = "http://www.docmirror.cn:7070/api/upload/form/download?key=" + value;
resolve(url);
});
return "http://www.docmirror.cn:7070/api/upload/form/download?key=" + value;
}
}
}
Expand Down

0 comments on commit 89c6fc6

Please sign in to comment.