|
|
@@ -10,42 +10,58 @@ export const hostname = 'localhost'; |
|
|
|
const hostPort = '8090'; |
|
|
|
export const hostPath = `http://${hostname}:${hostPort}`; |
|
|
|
//export const apiPath = `http://192.168.0.112:8090/api`; |
|
|
|
<<<<<<< HEAD |
|
|
|
//export const apiPath = `${hostPath}/api`; |
|
|
|
export const apiPath = `/api`; |
|
|
|
======= |
|
|
|
|
|
|
|
export const apiPath = `${hostPath}/api`; |
|
|
|
//export const apiPath = `/api`; |
|
|
|
>>>>>>> master |
|
|
|
|
|
|
|
export const paymentPath = `http://pnspsdev.gld.gov.hk/payment`; |
|
|
|
|
|
|
|
export const iAmSmartPath = `https://apigw-isit.staging-eid.gov.hk`; |
|
|
|
export const clientId = "cf61fa7c121e4869966f69c8694b1cd2"; |
|
|
|
export const getBowerType=()=>{ |
|
|
|
|
|
|
|
export const iAmSmartCallbackPath = () => { |
|
|
|
let hostname = window.location.hostname; |
|
|
|
if (hostname.match("localhost")) { |
|
|
|
hostname = "pnspsuat.gld.gov.hk"; |
|
|
|
} |
|
|
|
return hostname; |
|
|
|
}; |
|
|
|
|
|
|
|
export const getNonce = () => { |
|
|
|
let hostname = window.location.hostname; |
|
|
|
if (hostname.match("localhost")) { |
|
|
|
hostname = "pnspsuat.gld.gov.hk"; |
|
|
|
} |
|
|
|
return hostname; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const getBowerType = () => { |
|
|
|
console.log(navigator.userAgent) |
|
|
|
// const regex = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Mi|huawei|Opera Mini|SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i; |
|
|
|
// if(!regex.test(navigator.userAgent)) |
|
|
|
|
|
|
|
if (navigator.userAgent.indexOf("Edg") != -1) { |
|
|
|
if(navigator.userAgent.match(/Android/i)) return "Android_Edge" |
|
|
|
if(navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Edge" |
|
|
|
if (navigator.userAgent.match(/Android/i)) return "Android_Edge" |
|
|
|
if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Edge" |
|
|
|
return "PC_Browser" |
|
|
|
}else if(navigator.userAgent.indexOf("Chrome") != -1){ |
|
|
|
if(navigator.userAgent.match(/Android/i)) return "Android_Chrome" |
|
|
|
if(navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Chrome" |
|
|
|
} else if (navigator.userAgent.indexOf("Chrome") != -1) { |
|
|
|
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){ |
|
|
|
if(navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Safari" |
|
|
|
} else if (navigator.userAgent.indexOf("Safari") != -1) { |
|
|
|
if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Safari" |
|
|
|
return "PC_Browser" |
|
|
|
}else if(navigator.userAgent.indexOf("Firefox") != -1){ |
|
|
|
if(navigator.userAgent.match(/Android/i)) return "Android_Firefox" |
|
|
|
if(navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Firefox" |
|
|
|
} else if (navigator.userAgent.indexOf("Firefox") != -1) { |
|
|
|
if (navigator.userAgent.match(/Android/i)) return "Android_Firefox" |
|
|
|
if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) return "iOS_Firefox" |
|
|
|
return "PC_Browser" |
|
|
|
}else if(navigator.userAgent.match(/SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i)){ |
|
|
|
} else if (navigator.userAgent.match(/SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i)) { |
|
|
|
return "Android_Samsung" |
|
|
|
}else if(navigator.userAgent.match(/huawei/i)){ |
|
|
|
} else if (navigator.userAgent.match(/huawei/i)) { |
|
|
|
return "Android_Huawei" |
|
|
|
}else if(navigator.userAgent.match(/Mi/i)){ |
|
|
|
} else if (navigator.userAgent.match(/Mi/i)) { |
|
|
|
return "Android_Xiaomi" |
|
|
|
} |
|
|
|
return "PC_Browser"; |
|
|
|