WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2022-06-13 bfff9c67052781de46be61a7ed378a4b65221e58
工具集增加生成随机字符串的功能
1 files modified
16 ■■■■■ changed files
common/Tools.js 16 ●●●●● patch | view | raw | blame | history
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) {