核心
num += str.charAt(Math.floor(Math.random() * str.length));
// 32位随机数
randomString(length) {
let str = 'ABCDEFGHIJKIMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
let num = '';
for (let i = 0; i < 32; i++) {
num += str.charAt(Math.floor(Math.random() * str.length));
}
return num;
},
//使用randomString方法
payment() {
var randomString = this.randomString();
}