0.0.5 • Published 2 years ago

@beyounger/validator v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

validator

npm 引入

yarn add @beyounger/validator
# or with npm
npm install @beyounger/validator
import Device from '@beyounger/validator'

/**
* @params:{
*  siteid: siteid;
*  getGeoPostion:  是否获取地理信息 不传默认 false 
*  
* }
*
* @return: 返回 token
*/
const siteid = "your siteid"

const token = await Device.Report(siteid, false)

或

const siteid = "your siteid"

const token = await Device.Report(siteid)

script 引入

最新版本

固定版本

usage

获取token

const siteid = "your siteid"
const token = await Device.Report(siteid, false,)


const token = Device.Report(siteid, false,).then( token => {
    console.log(token)
})

通过EventListener

Device.Report(siteid, false,)
document.addEventListener('beyounger:token', (event) => { 
    console.log('event')
    console.log(event.detail);
 });
0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago