angular string转base64

base64encoder(Context:string){
     
    let encoder = new Buffer(Context).toString('base64');
    return encoder;
}

angular string转base64_第1张图片

解决方法:在项目的polyfills.ts中增加

(window as any).global = window;
// @ts-ignore
window.Buffer = window.Buffer || require('buffer').Buffer;

你可能感兴趣的:(angular string转base64)