1. //生成uuid
    2. generateUUID: () => {
    3. let d = new Date().getTime();
    4. if (window.performance && typeof window.performance.now === "function") {
    5. d += performance.now(); //use high-precision timer if available
    6. }
    7. let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
    8. let r = (d + Math.random() * 16) % 16 | 0;
    9. d = Math.floor(d / 16);
    10. return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
    11. });
    12. return uuid;
    13. }