root 2 years ago
parent
commit
2b7b669ca3
2 changed files with 6 additions and 3 deletions
  1. 4 3
      src/components/App.tsx
  2. 2 0
      src/data/blob.ts

+ 4 - 3
src/components/App.tsx

@@ -4505,14 +4505,15 @@ class App extends React.Component<AppProps, AppState> {
         );
       }
     }
-    window.console.log(imageFile);
+    window.console.log(showCursorImagePreview);
     if (showCursorImagePreview) {
       const dataURL = this.files[fileId]?.dataURL;
       // optimization so that we don't unnecessarily resize the original
       // full-size file for cursor preview
       // (it's much faster to convert the resized dataURL to File)
+      window.console.log(dataURL);
       const resizedFile = dataURL && dataURLToFile(dataURL);
-
+      window.console.log(resizedFile);
       this.setImagePreviewCursor(resizedFile || imageFile);
     }
 
@@ -4530,7 +4531,7 @@ class App extends React.Component<AppProps, AppState> {
     //此处改成亚马逊上传后返回
     const dataURL =
       this.files[fileId]?.dataURL || (await Upload_AWS(imageFile));
-    window.console.log(dataURL);
+
     const imageElement = mutateElement(
       _imageElement,
       {

+ 2 - 0
src/data/blob.ts

@@ -226,6 +226,8 @@ export const getDataURL = async (file: Blob | File): Promise<DataURL> => {
 
 export const Upload_AWS = async (file: Blob | File): Promise<DataURL> => {
   return new Promise((resolve, reject) => {
+    window.console.log("ccccccccccccccccccccccccccccc");
+    window.console.log(file);
     const credentials = {
       accessKeyId: "AKIATLPEDU37QV5CHLMH",
       secretAccessKey: "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",