Anna Ho 11 месяцев назад
Родитель
Сommit
44325ecc10
1 измененных файлов: 8 добавлений и 5 удалений
  1. +8
    -5
      src/auth/utils.js

+ 8
- 5
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";
}

Загрузка…
Отмена
Сохранить