1+ /* eslint-disable no-unexpected-multiline */ 
12angular . module ( 'web' ) . factory ( 'ossSvs2' ,  [ 
23 '$q' , 
34 '$rootScope' , 
@@ -245,6 +246,7 @@ angular.module('web').factory('ossSvs2', [
245246 if  ( i . status  ===  'fulfilled' )  { 
246247 fulfilled . push ( i . value ) ; 
247248 }  else  { 
249+  // eslint-disable-next-line no-unused-expressions 
248250 i . status  ===  'rejected' ; 
249251
250252 if  ( Array . isArray ( i . reason ) )  { 
@@ -1200,14 +1202,15 @@ angular.module('web').factory('ossSvs2', [
12001202
12011203 if  ( taggingResult  &&  taggingResult . tag )  { 
12021204 tagging  =  Object . keys ( taggingResult . tag ) . map ( function ( k )  { 
1205+  // eslint-disable-next-line no-undef 
12031206 return  encodeURIComponent ( k )  +  '='  +  encodeURIComponent ( data [ k ] ) ; 
12041207 } ) . join ( '&' ) ; 
12051208 } 
12061209
12071210 let  encoding  =  headResult . ContentEncoding ; 
12081211 // code-modal保存时,如果encoding=gzip,就不变更gzip,避免内容未做gzip压缩,导致sdk中的urllib响应内容解析失败 
1209-  if ( isCodeSave  &&  encoding  ===  'gzip' ) { 
1210-  encoding = undefined ; 
1212+  if ( isCodeSave  &&  encoding  ===  'gzip' ) { 
1213+  encoding = undefined ; 
12111214 } 
12121215
12131216 client3 . put ( key ,  new  Buffer ( content ) ,  { 
@@ -1611,7 +1614,9 @@ angular.module('web').factory('ossSvs2', [
16111614 } ) ; 
16121615 } 
16131616
1614-  function  _listFilesOrigion ( region ,  bucket ,  key ,  marker  =  '' ,  length  =  1000 )  { 
1617+  function  _listFilesOrigion ( region ,  bucket ,  key ,  marker  =  '' ,  length )  { 
1618+  if  ( ! length )  length  =  localStorage . getItem ( "listObjectNum" )  ||  500 ; 
1619+  console . log ( 'list-object-max-length' ,  length ) ; 
16151620 const  client  =  getClient3 ( { 
16161621 region, 
16171622 bucket
@@ -1689,51 +1694,6 @@ angular.module('web').factory('ossSvs2', [
16891694
16901695 list ( marker ) ; 
16911696 } ) ; 
1692- 1693-  return  client . listV2 ( Object . assign ( { } ,  options ,  {  'continuation-token' : marker  } ) ) 
1694-  . then ( ( resp )  =>  { 
1695-  const  dirs  =  ( resp . prefixes  ||  [ ] ) 
1696-  . filter ( ( n )  =>  n  !==  key ) 
1697-  . map ( ( n )  =>  { 
1698-  const  arr  =  n . split ( '/' ) . filter ( ( k )  =>  ! ! k ) ; 
1699-  const  name  =  arr [ arr . length  -  1 ] ; 
1700- 1701-  return  { 
1702-  isFolder : true , 
1703-  itemType : 'folder' , 
1704-  path : n , 
1705-  name : name  ===  '/'  ? name  : name . replace ( / \/ $ / ,  '' ) 
1706-  } ; 
1707-  } ) ; 
1708-  const  objects  =  ( resp . objects  ||  [ ] ) 
1709-  . filter ( ( n )  =>  n . name  !==  key ) 
1710-  . map ( ( n )  =>  { 
1711-  const  arr  =  n . name . split ( '/' ) . filter ( ( k )  =>  ! ! k ) ; 
1712-  const  name  =  arr [ arr . length  -  1 ] ; 
1713- 1714-  return  Object . assign ( n ,  { 
1715-  isFile : true , 
1716-  itemType : 'file' , 
1717-  path : n . name , 
1718-  name : name 
1719-  } ) ; 
1720-  } ) ; 
1721- 1722-  return  { 
1723-  data : { 
1724-  dirs, 
1725-  objects
1726-  } , 
1727-  marker : resp . nextContinuationToken , 
1728-  truncated : resp . isTruncated , 
1729-  maxKeys : + resp . keyCount 
1730-  } ; 
1731-  } ) 
1732-  [ 'catch' ] ( ( e )  =>  { 
1733-  handleError ( e ) ; 
1734- 1735-  return  Promise . reject ( e ) ; 
1736-  } ) ; 
17371697 } 
17381698
17391699 function  listAllFiles ( region ,  bucket ,  key ,  folderOnly )  { 
@@ -1997,7 +1957,7 @@ angular.module('web').factory('ossSvs2', [
19971957 } 
19981958
19991959 return  ( 
2000-  protocol  +  '//'  +  bucket  +  '.'  +  region  +  '.aliyuncs.com'  + ' /'+  key 
1960+  protocol  +  '//'  +  bucket  +  '.'  +  region  +  '.aliyuncs.com/'  +  key 
20011961 ) ; 
20021962 } 
20031963
@@ -2018,7 +1978,7 @@ angular.module('web').factory('ossSvs2', [
20181978 } 
20191979
20201980 return  ( 
2021-  protocol  +  '//'  +  bucket  +  '.'  +  region  +  '.aliyuncs.com'  + ' /'+  key 
1981+  protocol  +  '//'  +  bucket  +  '.'  +  region  +  '.aliyuncs.com/'  +  key 
20221982 ) ; 
20231983 } 
20241984
0 commit comments