npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wodax-login-qrcode.react

v1.5.6

Published

login component with qrcode for WodaX applications

Downloads

6

Readme

WodaX 扫二维码登录组件

NPM version NPM downloads

安装

$ npm i wodax-login-qrcode.react
# 或 
$ yarn add wodax-login-qrcode.react

功能特性

  • 支持HTML5 EventSource 获取实时反馈;
  • 支持自定义二维码显示样式;
  • 支持外接API方式获取二维码;
  • 支持自定义渲染接口;
  • 支持调试日志输出;
  • 高性能低占用率
  • 高级可定制

使用说明

Demo

import WodaXLoginWithQrCode from 'wodax-login-qrcode.react';
 
 
const Example = () => (
  <WodaXLoginWithQrCode />
);
 

当前可用的Props

WodaXLoginWithQrCode.defaultProps = {
  className: `wodax-login-with-qrcode`,
  Style: {},

  // 是否开启日志调试
  debugEnable: false,

  // 可选项
  options: {
    // 基础参数: {eventSource使用}

    // 是否使用EventSource来重新获取最新QrCode
    useEventSourceForFetchQrCode: false,
    clientEventSource: {
      // EventSource 主要服务url
      url: `https://stream.wikimedia.org/v2/stream/recentchange`,
      // EventSource 附带参数
      params: {},
      // EventSource 可以处理的消息类型
      messageTypes: [`message`],
      // withCredentials
      withCredentials: false,
      // EventSource 是否保存所有
      saveAllEvents: false,
    },

    // 基础参数: {Title使用}
    title: `打开App,扫码登录`,
    titleClassName: `qr-login-title`,
    appLogo: ``,

    // QrCode 二维码配置
    qrCodeConfig: {
      renderAs: `canvas`,
      size: 128,
      bgColor: `#FFFFFF`,
      fgColor: `#000000`,
      level: `L`,
      includeMargin: false,
    },
    qrCodeContainerOpacity: {
      min: 0.01,
      max: 1,
    },

    // 提示信息
    toolTipContainerClassName: `qr-login-tooltip`,
    toolTipContainerStyle: {
      padding: '4px',
      position: 'absolute',
    },
    codeOutWorkText: `二维码已失效`,
    loginFailedText: `登录失败`,
    loginSuccessText: `登录成功`,
    qrCodeGetFailedText: `获取二维码失败`,
    scanCompleteText: `扫描成功! 请在手机上确认登录`,

    // 基础参数: {刷新区域,重新获取二维码}
    // 是否一直显示刷新区域
    refreshContainerShowEveryTime: false,
    refreshContainerProps: {
      style: {
        padding: '4px',
        position: 'absolute',
        marginTop: '40px',
      },
    },
    // 点击刷新
    refreshButtonCaption: `请点击刷新`,
    refreshButtonElement: `button`,
    refreshButtonProps: {
      style: {
        padding: '4px',
      },
    },

    // 基础参数: {实时信息接收处理}

    // 是否默认显示sse回显信息
    showSSEMessage: false,
  },

  // 数据请求接口,可以覆盖
  fetchQrCodeHandler: _default.fetchQrCodeHandler,

  // 数据反馈接口。外接应用,可以自己处理所有来自服务器的消息
  onReceiveMessageHandler: _default.onReceiveMessageHandler,

  // 渲染接口, 可以覆盖,重新写
  titleRender: _default.titleRender,
  qrCodeRender: _default.qrCodeRender,
  toolTipRender: _default.toolTipRender,
  additionLayerRender: _default.additionLayerRender,
  refreshQrCodeRender: _default.refreshQrCodeRender,
  sseMessageRender: _default.sseMessageRender,
};

在线文档运行

$ npm run website:run
# 或
$ yarn website:run

开发维护

构建

# 建议在兼容Linux的终端中运行,如Windows的WSL、或者Git Bash
$ yarn build

授权信息

MIT