see MDN Web Docs  https see MDN Web Docs  https ( function ( ) { try { class Base64 { static encode ( str ) { return btoa ( encodeURIComponent ( str ) . replace ( /%([0-9A-F]{2})/g , function ( match , p1 ) { return String . fromCharCode ( < any > ( '0x' + p1 ) ) ; } ) ) ; } static decode ( str ) { return decodeURIComponent ( atob ( str ) . split ( '' ) . map ( function ( c ) { return '%' + ( '00' + c . charCodeAt ( 0 ) . toString ( 16 ) ) . slice ( - 2 ) ; } ) . join ( '' ) ) ; } } API . Base64 = { encode : ( str ) => Base64 . encode ( str ) , decode : ( str ) => Base64 . decode ( str ) } ; } catch ( e ) { toast . error ( "base64.js" , e ) ; } } ) ( ) ; declare namespace API { /**
     * Base64编解码工具
     */ let Base64 ; }