wvStore.uts 694 B

12345678910111213141516171819202122
  1. // 页面
  2. let pageStoreMap = new Map<string, string>();
  3. // webviewContext
  4. let webviewContextStoreMap = new Map<string, WebviewContext>();
  5. // 临时存储
  6. let tempStoreMap = new Map<string, string>();
  7. function uuid(length : number) : string {
  8. let uuid : string = "";
  9. let chars : string[] = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  10. for (let i = 0; i < length; i++) { uuid += chars[Math.floor(Math.random() * chars.length)]; };
  11. return uuid;
  12. };
  13. function getCurrentPagesRoute() : string {
  14. const _pages = getCurrentPages();
  15. return _pages[_pages.length - 1].route;
  16. }
  17. export {
  18. pageStoreMap, tempStoreMap, webviewContextStoreMap, uuid, getCurrentPagesRoute
  19. }