@mylinkpi/cli-login
v1.0.3
Published
连接派登录工具
Downloads
156
Keywords
Readme
login
description
get ad\token\device_id in file: .login
dependency
npm pnpm i
usage
node login.js
or
npm run login
logout:
npm run logout
or delete .login file
用函数调用
const login = require('./login')
console.log('start')
const f = await login.asyncLogin();
if (!f) {
console.log('login failed')
return
}
if (f) {
console.log('login success')
}
const {ad, token, device_id} = await login.adToken();
console.log(ad, token, device_id)
{
await login.logout()
let {ad, token, device_id} = await login.adToken();
console.log(ad, token, device_id)
}
调用时传参定义用户环境
const login = require('./login')
console.log('start')
const f = await login.asyncLogin('https://test.***.com');
if (!f) {
console.log('login failed')
return
}