publicFunc.js 395 B

1234567891011121314
  1. //随机id生成
  2. const buildGuid = function (options) {
  3. var text = "";
  4. var mar = options || "default";
  5. var possible =
  6. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  7. for (var i = 0; i < 18; i++)
  8. text += possible.charAt(Math.floor(Math.random() * possible.length));
  9. return mar + "_" + new Date().getTime().toString() + text;
  10. };
  11. export default{
  12. buildGuid
  13. }