uaredirect.js 572 B

12345678910111213141516
  1. export function uaRedirect() {
  2. try {
  3. if (document.getElementById("bdmark") != null) {
  4. return;
  5. }
  6. var urlhash = window.location.hash;
  7. if (!urlhash.match("fromapp")) {
  8. if ((navigator.userAgent.match(/(iPhone|iPod|ios)/i) ||
  9. (navigator.userAgent.match(/(Android)/i) && navigator.userAgent.match(/(Mobile)/i)))) {
  10. if (process.env.VUE_APP_MOBILE) {
  11. window.location.href = process.env.VUE_APP_MOBILE;
  12. }
  13. }
  14. }
  15. } catch (err) { }
  16. }