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 🙏

© 2026 – Pkg Stats / Ryan Hefner

crm-common-login

v0.0.68

Published

百度 CRM 统一登录

Readme

web端统一登录框

##简介 统一登录框包含两种模式,一种是集成主账号和子账号的界面,另一种是只有子账号的界面;通过参数showType来控制切换两种界面显示。 主账号:是uc的账号体系,使用时需要初始化uc相关的参数才能成功; 子账号:是pass的账号体系,使用时需要初始化pass的相关参数;

##安装 npm install --save aifanfanlogin

##使用 import Login from '@baidu/aifanfanlogin'; 或者 var Login = require('aifanfanlogin');

包含主账号和子账号的界面初始化: var login = new Login({ showType: 'multi', id: 'login', hideBottom: false, ucappid: 587, passappid: 1, deviceType: 'web', ucAppKey: 'aifanfan.baidu.com', cookieDomain: 'aifanfan.baidu.com', redirectUrl: 'http://www.aifanfan.com', registerUcLink: 'https://u.baidu.com/ucweb/?module=Reguser&controller=reg&action=index&appid=3', staticPage: 'http://test.baidu.com:8080/v3Jump.html', ucJs: 'http://cas.baidu.com/staticv2/dep/common-login/qa-api.js', serverHost: 'http://crmpaas-test.baidu.com', reqRealTokenHost: 'http://crmpaas-test.baidu.com', deviceCode: 'web', loginDevice: 'web', appVersion: '1.0.0' });

只包含子账号的界面初始化: var login = new Login({ showType: 'single', id: 'login', hideBottom: true, passappid: 1, deviceType: 'web', redirectUrl: 'http://www.aifanfan.com', serverHost: 'http://crmpaas-test.baidu.com', reqRealTokenHost: 'http://crmpaas-test.baidu.com', deviceCode: 'web', loginDevice: 'web', appVersion: '1.0.0' });

##参数说明 |参数 | 是否必须 | 类型 | 说明 | |---|---|---|---| |showType | 是 | string | 'multi'表示主子账号登录界面同时存在,包含tab切换;'single'表示只有子账号登录界面 | |id | 是 | string | 登录框需要绑定的dom标签id | |hideBottom | 否 | boolean | 子账号是否需要隐藏底部的“注册”和“忘记密码” | |ucappid | 是 | number | 产品在uc注册的appid,当showType为‘multi’时必填参数 | |passappid | 是 | number | 产品在pass注册的appid | |deviceType | 是 | string | 设备来源(目前写web) | |ucAppKey | 是 | string | 产品在uc注册的appkey,当showType为‘multi’时必填参数 | |cookieDomain | 是 | string | 产品在uc注册的cookieDomain,当showType为‘multi’时必填参数 | |redirectUrl | 否 | string | 登录成功后跳转到的页面地址 | |registerUcLink | 是 | string | 主账号底部注册跳转地址,当showType为‘multi’时必填参数 | |staticPage | 是 | string | 跨域用静态页面,要求必须与当前接入网站域名,协议,端口一致,并且必须使用完整url路径,比如接入登录的页面为 http://cas.baidu.com/?tpl=www2,那么StaticPage则为 http://cas.baidu.com/asset/noJump/v3Jump.html ,当showType为‘multi’时必填参数 | |ucJs | 是 | string | uc登录框集成需要引入的api文件地址,当showType为‘multi’时必填参数 | |serverHost | 是 | string | pass登录对应的后端接口域名前缀(线下调试时可换成对应的测试地址) | |reqRealTokenHost | 是 | string | 最后一个换取真实token的接口的域名前缀 | |callback | 否 | function | pass登录成功后的回调函数,如果设置了callback则子账号的redirectUrl无效,res是登录成功后返回的网关校验数据 | |deviceCode | 是 | string | 子账号登录时设备唯一编码web端值为‘web’ | |loginDevice | 是 | string | 子账号登录时登录设备(pc/ios/android/web),web端值为‘web’ | |appVersion | 是 | string | 子账号登录时应用版本号 |

##uc主账号使用注意 需要在自己的域下(域、端口、协议都要和使用这个api的页面相同)部署一个jump的页面,即下面介绍中的staticPage选项,页面内容获取地址: http://cas.baidu.com/asset/noJump/v3Jump.html

联调/测试都需要使用百度域名

##ucJs参数的api文件地址 需以无缓存方式引入api.js文件,该文件压缩后仅有2k大小,所以无须担心性能问题 线上js调用请使用 http(s)://cas.baidu.com/staticv2/dep/common-login/api.js QA测试用js请使用 http(s)://cas.baidu.com/staticv2/dep/common-login/qa-api.js RD测试用js请使用 http(s)://cas.baidu.com/staticv2/dep/common-login/rd-api.js

注意:当QA,RD环境在配置正确的情况下出现登录超时提示,请按照以下方案进行配置:

1.RD环境在浏览器访问https://mycas.baidu.com:8443,同意证书后重新刷新登录页面

2.QA环境在浏览器访问https://cas-off.baidu.com:8443,同意证书后重新刷新登录页面