Math.random

 createdKey() {
            var letters = 'abcdefghijklmnopqrstuvwxyz0123456789';
            var token = '';
            for (var i = 0; i < 32; i++) {
                var j = parseInt(Math.random() * (31 + 1));
                token += letters[j];
            }
            this.mch_key = token;
        },
原文地址:https://www.cnblogs.com/xiaoxiaoxun/p/13782074.html