const encoder = new TextEncoder(); const string = "要转换为二进制的字符串"; const binaryArray = encoder.encode(string); 扩展阅读 javascript 如何将字符串转为二进制? Blob 对象 createObjectURL