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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@efox/efox-login

v0.1.5

Published

efox-login是由Efox前端组开发的适用于web、pc接入UDB登录系统的工具类,包含手机验证码登录、用户名+密码登录、手机号注册、找密、第三方登录等方式 ## 接入准备 - appid申请:申请UDB业务标识 - 第三方平台应用申请和配置(按需)

Downloads

62

Readme

efox-login

概述

efox-login是由Efox前端组开发的适用于web、pc接入UDB登录系统的工具类,包含手机验证码登录、用户名+密码登录、手机号注册、找密、第三方登录等方式

接入准备

  • appid申请:申请UDB业务标识
  • 第三方平台应用申请和配置(按需)

安装

npm install @efox/efox-login --save

引入

import EfoxLogin from '@efox/efox-login'

or

const EfoxLogin = require('@efox/efox-login')

配置字段说明

| 字段 | 说明 | 类型 | 是否必传 | 可选值 | 默认值 | | :------ | :------ | :------ | :------ | :------ | :------ | | appid | UDB业务appid | string | true | - | - | | methods | 登录方式 | array | false | 'phone' 'social' | ['phone'] | | region | 地区 | string | true | 各地区编码 | 'CN' | | domain | 业务域名不带前缀 | string | true | - | - | | redirect | 授权回调的地址 | string | 第三方登录必传 | - | - | | socialAuth | 第三方应用编号和key集合 | object | 第三方登录必传 | - | - | | width | 第三方登录弹窗宽度 | number | false | - | 800 | | height | 第三方登录弹窗高度 | number | false | - | 600 | | state | 第三方授权回调带回状态 | string | false | - | - | | lang | 语言 | string | false | - | 'zh-cn' | | dir | 排版方向 | string | false | 'ltr' 'rtl' | 'ltr' |

| 方法 | 说明 | 回传参数 | | :------ | :------ | :------ | | onLoginSuccess | 登录成功回调 | {uid: string, isNew: boolean, method: string} | onLoginFail | 登录失败回调 | {code: int, msg: string, method: string} | | onRegClick | 点击注册回调 | - | | onFindPwdClick | 点击忘记密码回调 | - | | onRegSuccess | 注册成功回调 | - | | onFindPwdSuccess | 修改密码成功回调 | - |

实例化示例

const efoxLogin = new EfoxLogin({
  appid: '1170901840',
  methods: ['phone', 'social'],
  region: 'US',
  domain: 'hamo.tv',
  redirect: 'https://test.hamo.tv/redirect',
  socialAuth: {
    facebook: {
      appid: '2008835592494324',
      secret: '86210a0fdf5918aafdaa938d6d0f83bf'
    }
  },
  width: 800,
  height: 600,
  state: '',
  lang: 'en-my',
  onLoginSuccess: msg => {
    console.log(msg)
  },
  onLoginFail: e => {
    console.log(e)
  },
  onRegClick: () => {
    console.log('点击注册')
  },
  onFindPwdClick: () => {
    console.log('点击忘记密码')
  },
  onRegSuccess: () => {
    console.log('注册成功')
  },
  onFindPwdSuccess: () => {
    console.log('修改密码成功')
  },
})

efoxLogin对象下的属性与方法

属性

| 属性名 | 说明 | 类型 | | :------ | :------ | :------ | | phoneLoginSrc | 手机登录iframe的src | string | | phoneFindPwdSrc | 手机注册iframe的src | string | | phoneRegisterSrc | 忘记密码iframe的src | string |

方法

  • socialLogin

| 参数名 | 说明 | 类型 | | :------ | :------ | :------ | | channel | 第三方登录平台名称(全小写) | string |

facebookBtn.onclick = efoxLogin.socialLogin({
  channel: 'facebook'
})

注意事项

确保实例化代码在web应用能够调起登录的界面和授权回调界面能够被执行

仓库地址

http://git.yypm.com/efox/efox-login