1.0.2 • Published 6 years ago

huawei-no v1.0.2

Weekly downloads
5
License
MIT
Repository
-
Last release
6 years ago

huawei-no

介绍

判断是否是华为设备并禁止华为设备使用
目前支持判断华为和荣耀设备
华为尊重每一位劳动者,践踏劳动者的尊严可耻之极!

使用方法

安装方法

npm install huawei-no

使用方法

使用代码

let hw = require('huawei-no');
let res = hw.isHW(type); //判断是否是华为设备,返回布尔值 true 和 false
hw.HWNO(type, callback); //判断如果是华为设备,警告或执行回调方法

//事例
hw.HWNO('all', '请勿使用华为设备访问本系统!');
hw.HWNO('huawei', res => {
  if (res) {
    alert('请勿使用华为设备访问本系统!');
  } else {
    console.log('感谢使用非华为设备!');
  }
});
let res = hw.isHW();
if (res) {
  alert('请勿使用华为设备访问本系统!');
} else {
  console.log('感谢使用非华为设备!');
}

参数说明

Type值
Type值默认值说明
alltrue全部华为系产品
huaweifalse华为产品
honorfalse荣耀产品
CallBack值
callback类型默认值说明
trueconsole.log('警告:您正在使用华为设备,该系统禁止华为设备访问!') 和 alert('警告:您正在使用华为设备,该系统禁止华为设备访问!')
functionfalse执行回调function
stringfalseconsole.log(string) 和 alert(string)
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago