index.ts 653 B

1234567891011121314151617181920212223242526
  1. import { getURLSearchParams } from '@/tools';
  2. const userAgent = navigator.userAgent;
  3. export function platformIsAIO() {
  4. return /Six\/applet \(AIO;.+\)/i.test(userAgent) || /aio\/\w+/i.test(userAgent);
  5. }
  6. export function platformIsAIO_1() {
  7. return /aio\/1\.0/i.test(userAgent);
  8. }
  9. export function getSerialNumberSync() {
  10. const match = userAgent.match(/sn\/(\w+)/i);
  11. return match?.[ 1 ] ?? (
  12. function() {
  13. const query = getURLSearchParams();
  14. return query.get('serial') ?? query.get('serialNumber') ?? query.get('sn') ?? void 0;
  15. }
  16. )();
  17. }
  18. export * from './dialog.ui';
  19. export * from './notify.ui';
  20. export * from './toast.ui';