// 数字图片，然后base64的图片
export const randomPng = (content: number | string = 1) =>{ 
  const canvas = document.createElement('canvas');
  const ctx = canvas.getContext('2d')!;
  const size = 128;
  canvas.width = size;
  canvas.height = size;
  ctx.fillStyle = '#'+Math.floor(Math.random()*16777215).toString(16);
  ctx.fillRect(0, 0, size, size);
  ctx.font = 'bold 32px Arial';
  ctx.fillStyle = '#ffffff';
  ctx.textAlign = 'center';
  ctx.textBaseline = 'middle';
  ctx.fillText(content.toString(), size / 2, size / 2);
  return canvas.toDataURL();
}