生成uuid随机字符串:
export const getDeviceId = () => {
if (!window['randDeviceId']) {
window['randDeviceId'] =
`${new Date().getTime().toString(32)}_` +
`${Math.random().toString(32).substr(2, 6)}_` +
`${Math.random().toString(32).substr(2, 6)}_` +
`${Math.random().toString(32).substr(2, 6)}`;
}
return window['randDeviceId'];
};