diff --git a/src/utils/unique.js b/src/utils/unique.js index 796ee26..a77d8a8 100644 --- a/src/utils/unique.js +++ b/src/utils/unique.js @@ -3,17 +3,21 @@ * TheoXiong */ -const now = () => { - let current = Date.now() - let last = now.last || current - now.last = current > last ? current : last + 1 - return now.last -} +// const now = () => { +// let current = Date.now() +// let last = now.last || current +// now.last = current > last ? current : last + 1 +// return now.last +// } + +const uuid = function () { + return Math.random().toString(36).substr(2, 10); +}; const unique = (prefix = '', suffix = '') => { - return prefix + now().toString(16) + suffix + return prefix + uuid() + suffix } export { unique -} \ No newline at end of file +}