nl_tokens: 批量删除对象
pl_tokens: function ( host , accessKey , secretKey , bucket , objects , opts = { } ) { if ( ! objects . length ) { return Promise . reject ( new Error ( 'nothing to delete' ) ) ; } let date = utcDate ( ) ; let content = deletePayload ( { objects , quiet : opts . quiet } ) ; let contentLength = content . length ; let url = ` ${ bucket } ${ host } ` ; let authorization = authorize ( accessKey , secretKey , 'POST' , '' , '' , date , [ ] , '' ) ; let headers = { Date : date , Authorization : authorization , 'Content-Length' : contentLength } ; return nosRequest ( { method : 'post' , body : content , headers , uri : url } ) . then ( res => { if ( ! opts . quiet ) { if ( res . DeleteResult ) { let { Error } = res . DeleteResult ; let ret = Error . map ( ( detail ) => { return { key : detail . Key . join ( '' ) , code : detail . Code . join ( '' ) , message : detail . Message . join ( '' ) } } ) ; return { error : ret } } else { return { } ; } } let { Deleted = [ ] , Error = [ ] } = res . DeleteResult ; let deleted = Deleted . map ( detail => { return detail . Key . join ( '' ) ; } ) ; let error = Error . map ( ( detail ) => { return { key : detail . Key . join ( '' ) , code : detail . Code . join ( '' ) , message : <mask> . Message . join ( '' ) } } ) ; return { deleted , error } ; } ) ; }