//生成随机数 export const getUUID = function (len) { len = len || 6; len = parseInt(len, 10); len = isNaN(len) ? 6 : len; var seed = "0123456789abcdefghijklmnopqrstubwxyzABCEDFGHIJKLMNOPQRSTUVWXYZ"; var seedLen = seed.length - 1; var uuid = ""; while (len--) { uuid += seed[Math.round(Math.random() * seedLen)]; } return uuid; }; //深拷贝 export const deepcopy = function (source) { if (!source) { return source; } let sourceCopy = source instanceof Array ? [] : {}; for (let item in source) { sourceCopy[item] = typeof source[item] === 'object' ? deepcopy(source[item]) : source[item]; } return sourceCopy; };