|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
-
-
-
-
- export function isNull(o) {
- if (o === null || o === undefined || o === '') {
- return true;
-
- } else if (Array.prototype.isPrototypeOf(o) && o.length === 0) {
- return true;
-
- } else if (Object.prototype.isPrototypeOf(o) && Object.keys(o).length === 0) {
- return true;
- }
- return false;
- }
-
- export function isNotNull(o) {
- return !isNull(o);
- }
-
-
- export function isAlipayBrowser(userAgent) {
- if (/AlipayClient/.test(userAgent)) {
- console.log("当前浏览器是支付宝浏览器");
- return true;
- } else {
- console.log("当前浏览器是非支付宝浏览器");
- return false;
- }
- }
-
-
- export function isAndroid(userAgent) {
- if (userAgent.indexOf('Android') > -1 || userAgent.indexOf('Linux') > -1) {
- console.log("当前用户设备是android");
- return true;
- } else if (userAgent.indexOf('iPhone') > -1) {
- console.log("当前用户设备是ios");
- return false;
- }
- }
|