common/Tools.js
@@ -70,6 +70,22 @@ } /** * 获取随机字符串 * @param {number} long * @return {string} */ static getRandomString(long) { long = long || 32; const template = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; const count = template.length; let result = ''; for (let i = 0; i < long; i++) { result += template.charAt(Math.floor(Math.random() * count)); } return result; } /** * 检查网络状态 */ static checkOnlineState(callback) {