🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

nw-login-readapp

Package Overview
Dependencies
Maintainers
10
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nw-login-readapp

> 同步登录阅读客户端组件

latest
npmnpm
Version
1.22.1
Version published
Weekly downloads
3
200%
Maintainers
10
Weekly downloads
 
Created
Source

nw-login-readapp

同步登录阅读客户端组件

安装

$ yarn add nw-login-readapp

example 1

import LoginReadApp from 'nw-log';
//快速登录
const loginReadApp = new LoginReadApp();

//客户端不强制登录
loginReadApp.syncLoginAtApp(true, false)
//客户端强制登录
loginReadApp.syncLoginAtApp(true, true)
//登录成功后,执行回调函数
loginReadApp.syncLoginAtApp(true, true, function(){xxx})

example 2

import LoginReadApp from 'nw-log';
//先调用logout退出,非快速登录
const loginReadApp = new LoginReadApp({csrf_token: 'xxx'});

//客户端不强制登录
loginReadApp.syncLoginAtApp(false, false)
//客户端强制登录
loginReadApp.syncLoginAtApp(false, true)

API

Classes

LoginReadApp

LoginReadApp实现了客户端内的同步登录,若客户端已登录,会同步登录信息到H5,若客户端未登录,可以根据参数来决定是否调起客户端登录

Functions

syncLoginAtApp(fastLogin, needLogin, loginCallback)

调用该方法完成同步登录

LoginReadApp

LoginReadApp实现了客户端内的同步登录,若客户端已登录,会同步登录信息到H5,若客户端未登录,可以根据参数来决定是否调起客户端登录

Kind: global class
See: 源码
Author: SherryWu

new LoginReadApp(config)

ParamTypeDescription
configObject相关配置
config.csrfTokenboolean后端提供的 CSRF token,若调用syncLoginAtApp时fastLogin为true,则不需要该参数

syncLoginAtApp(fastLogin, needLogin, loginCallback)

调用该方法完成同步登录

Kind: global function

ParamTypeDefaultDescription
fastLoginBooleantrue是否要先调用logout.json退出,默认值true:不logout直接登录
needLoginBooleanfalse若客户端未登录,是否要调起客户端登录,默认值false:不调起客户端登录
loginCallbackfunction同步登录成功后,调用的callback

FAQs

Package last updated on 31 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts