思路 随机生成四个数字。 PS:随便翻了一下博客看到以前写的可以用 Array 直接生成,不用通过字符串分解再计算。简单直接。 之前的代码: const captcha = '1234' .split('') .map(() => Math.floor(Math.random