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

@enncloud/enn-auth-sdk

v0.1.23

Published

auth sdk

Downloads

40

Readme

登录网址 测试环境

http://authentication-center.test.fnwintranet.com/login?redirect='+encodeURIComponent(重定向网址)+'&appid=业务appid

线上环境

http://authentication-center.fanneng.com/login?redirect='+encodeURIComponent(重定向网址)+'&appid=业务appid

注:重定向网址需用encodeURIComponent进行编码

登录跳转后对应jwt token会存入localstorage中ennUnifiedAuthorization字段

技术中台 > 统一鉴权前端SDK接入说明 > image2020-12-9_14-29-15.png

接入SDK,有以下必要步骤 安装引入 实例化并传入必要参数

第一步:安装引入 NPM形式(推荐使用) 安装SDK

npm i @enncloud/enn-auth-sdk -S

注意事项

如遇项目打包失败原因如下,

Unexpected token: punc «)»

建议使用terser-webpack-plugin 替换 uglifyjs-webpack-plugin

CDN形式

http://plantformcdn.fanneng.com/js/ennAuthSdk/1.0.0/enn-auth-sdk.js

第二步:实例化 以vue项目 main.js为例

NPM 形式 import引入

import EnnAuthSdk from "enn-auth-sdk";

CDN引入index.html中为例

window下会挂载EnnAuthSdk 无需手动引入

实例化并传参

new EnnAuthSdk( { appid:'someapp', //项目APPID baseUrl:'http://unified-authentication-demo.test.fnwintranet.com', //项目接口地址 env:'develop', //当前运行环境 develop or production warningCb:(message)=>{ Message({ type: 'error', message: message, showClose: true }) }//错误提示回调函数 } )

参数说明 1.appid 项目appid。必传

2.baseUrl 当前业务接口域名。(测试环境传入测试域名,生产传入生产域名)必传

3.env 当前项目运行环境 ‘develop’ or ‘production’。 必传

4.warningCb 错误提示回调函数,例如接口出现401,408等错误码返回码,是否需要提示,需要提示既传入提示函数,提示文案在回调messaeg参数里。非必传