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

c2-sso-client-bug-fix

v0.0.1

Published

c2-sso-client 1.1.5版本分支,修复遗留问题

Downloads

5

Readme

C2SSOClient

系统管理X单点登录node客户端,基于系统管理X1.1.3.2版本设计。

安装&使用

yarn add c2-sso-client
import initC2Client from 'c2-sso-client';

initC2Client({
    env: {
        C2_SYSX_NODE_SERVER_PORT: 3000, // 服务端口
        C2_SYSX_NODE_API_PREFIX: '/c2-node-api', // node接口前缀
        C2_SYSX_API_PREFIX: '/c2-sysx-api', // 系统管理X接口前缀
        C2_SYSX_BUSINESS_API_PREFIX: '/c2-sysx-business-api', // 业务模块接口前缀,可使用标准JSON以数组格式传入多个服务配置,如:["api-prefix-1", "api-prefix-2"]
        C2_SYSX_TARGET_URL: 'http://', // 系统管理X服务地址
        C2_SYSX_BUSINESS_TARGET_URL: 'http://', // 业务模块服务地址,可使用标准JSON以数组格式传入多个服务配置,如:["http://server-a.com", "http://server-b.com"]
        WEB_APP_TARGET_URL: 'http://', // 前端服务地址
        C2_SYSX_CLIENT_ID: '', // 客户端ID
        C2_SYSX_CLIENT_SECRET: '', // 客户端Secret
        C2_SYSX_CATEGORY_ID: '', // 系统管理X分类机构ID 
        C2_SYSX_WHITE_LIST: '', // 系统管理X白名单接口配置,以英文分号分割,
        C2_SYSX_BUSINESS_WHITE_LIST: '', // 业务模块白名单接口配置,可使用标准JSON以数组格式传入多个服务配置,如:["http://server-a.com", "http://server-b.com"]
        C2_SYSX_EXTENSIONS: '', // 扩展配置,满足前端需要动态配置参数的相关诉求
    },
    staticPath: '/src/web_app', // 静态资源目录,相对于项目根目录的路径
    isDebug: true, // 是否开启调试日志
    isRefreshToken: false // 是否开启刷新token的机制,由于系统X刷新token有bug,这个问题无解
});

node相关接口说明

公共模块

获取是否需要验证码校验

GET /common/need-captcha

query参数:

| key | 类型 | 备注 | |:-------:|:------:|:--:| | account | string | 账号 |

获取验证码

GET /common/captcha

query参数:

| key | 类型 | 备注 | |:------:|:------:|:---:| | random | string | 随机数 |

获取分类机构ID

GET /common/category-id

获取客户端ID

GET /common/client-id

获取扩展配置

GET /common/extensions

用户模块

系统管理X登录

GET /user/system-x-login

query参数:

| key | 类型 | 备注 | |:-----------:|:------:|:----------:| | redirectUrl | string | 登录完成后重定向路径 |

本接口请使用浏览器地址栏访问,需要重定向到系统管理X完成登录授权。

自定义登录

POST /user/custom-login

body参数:

| key | 类型 | 备注 | |:-----------:|:------:|:------------:| | account | string | 账号 | | password | string | 密码 | | captchaKey | string | 获取验证码时提交的随机数 | | captchaText | string | 验证码 |

登出

POST /user/logout

鉴权

GET /user/authorization