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

@xfe-team/universal-auth

v0.0.1

Published

西山居多端通用登录

Downloads

9

Readme

@xfe-team/universal-auth

西山居多端通用登录

安裝

  yarn add @xfe-team/universal-auth

基本用法

import {getAuthInfoByAppEnv, getDailyAuth, getQQWeixinAuth, getXoyoAuth, GeneralTools} from '@xfe-team/universal-auth'

/**
 * 自动根据App环境进行登录
 * @param daily daily端
 * @param limitOnlyHasJx3RoleAccessInDaily 是否限制只有存在剑网3角色的用户登录
 * @param weixinQQ 微信QQ端
 * @param xoyo 使用金山通行证登录
 * @param debug 是否进行登录信息提示
 * @param disable 禁止登录模块
 * @returns {Promise<GlobalAuthData>}
 * @type {GlobalAuthData}
 */
const data = await getAuthInfoByAppEnv({});
if (data.THIRD_PARTY_AUTH) {
  this.setState({
    userName: data.THIRD_PARTY_AUTH.data.uid || data.THIRD_PARTY_AUTH.data.account
  });
} 
else {
  this.setState({
    userName: data.XOYO_AUTH.data.account
  });
}

API

/**
 * 获取XOYO登录信息
 */
getXoyoAuth();

/**
 * 获取QQ微信端登录信息
 */
getQQWeixinAuth();

/**
 * 获取daily端登录信息
 * @param token daily token值
 * @param limitGuest 限制登录数: 默认为1
 * @param limitOnlyHasJx3RoleAccessInDaily 是否限制只有剑网3角色的账号的用户才能登录
 */
getDailyAuth();

/**
 * 自动根据App环境进行登录
 * @param daily daily端
 * @param limitOnlyHasJx3RoleAccessInDaily 是否限制只有存在剑网3角色的用户登录
 * @param weixinQQ 微信QQ端
 * @param xoyo 使用金山通行证登录
 * @param debug 是否进行登录信息提示
 * @param disable 禁止登录模块
 * @returns {Promise<GlobalAuthData>}
 * @type {GlobalAuthData}
 */
getAuthInfoByAppEnv({});

/**
 * 调用XOYO登录
 * 微信QQ, daily等第三方授权登录信息不需要额外的登录, 则方法提供的是xoyo登录功能
 */
GeneralTools.login()


/**
 * xoyo退出
 * @param shouldRefresh 是否刷新页面
 * @param onSuccess 退出成功的回调
 * @param onFail 退出失败的回调
 * @returns {Promise<*>}
 */
GeneralTools.logout();

ChangeLog

  • Add - when you introduce or expose a new feature, property, class, UI, etc.
  • Remove - when you fully removed something and it can no longer be used.
  • Deprecate - when you plan on removing something, but it is still accessible.
  • Fix an issue with/where… - when you fixed a bug.
  • Improve - when you made an existing thing better.
  • Update - when you refresh something, but don’t necessarily make it better.
  • Upgrade - when upgrading the version of a dependency.
  • Release - publish package.
  • Initial/Beta release of … - when releasing a brand-new feature.

0.0.2 (2020-11-02)

  • Fix: 修复 check-is-master-env 中补充输入的 "isMaster" 参数导致页面正常调用时 "isMaster" undefined报错的问题

0.0.1 (2020-10-28)

  • init: init commit. 整合 mobile-react-v4.1 版本中的三端登录的功能模块.

作者

李一鸿