文件上传检测
This commit is contained in:
parent
54e401abd5
commit
3f99e42fc0
|
@ -1573,6 +1573,7 @@ function _Chat() {
|
||||||
const imagesData: string[] = [];
|
const imagesData: string[] = [];
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const file = event.target.files[i];
|
const file = event.target.files[i];
|
||||||
|
console.log("file", file);
|
||||||
uploadImageRemote(file)
|
uploadImageRemote(file)
|
||||||
.then((dataUrl) => {
|
.then((dataUrl) => {
|
||||||
imagesData.push(dataUrl);
|
imagesData.push(dataUrl);
|
||||||
|
|
|
@ -138,7 +138,7 @@ export function uploadImage(file: Blob): Promise<string> {
|
||||||
})
|
})
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log("res", res);
|
console.log("upload res", res);
|
||||||
if (res?.code == 0 && res?.data) {
|
if (res?.code == 0 && res?.data) {
|
||||||
return res?.data;
|
return res?.data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue