From 44325ecc10e82ad9dd9f755d35f682c3cd22f7d3 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 9 Sep 2024 18:10:05 +0800 Subject: [PATCH] CriOS as iOS_Chrome --- src/auth/utils.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/auth/utils.js b/src/auth/utils.js index 48d7402..d42953b 100644 --- a/src/auth/utils.js +++ b/src/auth/utils.js @@ -42,7 +42,10 @@ export const getBowserType = () => { if (navigator.userAgent.match(/Android/i)) return "Android_Chrome" if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Chrome" return "PC_Browser" - } else if (navigator.userAgent.indexOf("Safari") != -1) { + } else if (navigator.userAgent.indexOf('CriOS') != -1) { + if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Chrome" + return "PC_Browser" + } else if (navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Chrome") == -1) { if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Safari" return "PC_Browser" } else if (navigator.userAgent.indexOf("Firefox") != -1) { @@ -74,7 +77,7 @@ export const isGranted = (auth) => { const abilities = getUserData() ? getUserData()["abilities"] : null; if (abilities == null || abilities.length == 0) return false; if (!Array.isArray(auth)) return _checkAuth(abilities, auth); - + if (auth.length > abilities.length) return false; let haveAuth = true; for (let i = 0; i < auth.length; i++) { @@ -123,8 +126,8 @@ export const local = { en: "en-us", zh: "zh-hk", cn: "zh-cn" }; export const preferpaymentmethods = ['visa', 'mastercard', 'pps', 'creditcard', 'fps']; export const getPaymentMethod = (paymentMethod) => { - if(paymentMethod == "online") return 'payOnlineMethod'; - if(paymentMethod == "demandNote") return 'payDnMethod'; - if(paymentMethod == "office") return 'payNPGOMethod'; + if (paymentMethod == "online") return 'payOnlineMethod'; + if (paymentMethod == "demandNote") return 'payDnMethod'; + if (paymentMethod == "office") return 'payNPGOMethod'; return "other"; } \ No newline at end of file