File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ const handle = async (ctx: IPicGo): Promise<IPicGo> => {
4545        const  base64Image  =  img . base64Image  ||  Buffer . from ( img . buffer ) . toString ( 'base64' ) 
4646        const  options  =  postOptions ( qiniuOptions ,  img . fileName ,  getToken ( qiniuOptions ) ,  base64Image ) 
4747        const  res  =  await  ctx . request ( options ) 
48+         console . log ( res ) 
4849        const  body  =  JSON . parse ( res ) 
4950        if  ( body ?. key )  { 
5051          delete  img . base64Image 
@@ -66,7 +67,7 @@ const handle = async (ctx: IPicGo): Promise<IPicGo> => {
6667    if  ( err . message  !==  'Upload failed' )  { 
6768      // err.response maybe undefined 
6869      if  ( err . response )  { 
69-         const  error  =  JSON . parse ( err . response . body   ||   '{}' ) 
70+         const  error  =  err . response . body 
7071        ctx . emit ( IBuildInEvent . NOTIFICATION ,  { 
7172          title : ctx . i18n . translate < ILocalesKey > ( 'UPLOAD_FAILED' ) , 
7273          body : error . error 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments