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

y9plugin-sso

v4.2.9

Published

<!-- /** @Author: Ye HAIFENG * @Date: 2025-03-03 09:38:24 * @Description: vue3.x * @FilePath: /y9plugin-sso/README.md */ --> # y9plugin-sso 插件使用说明

Downloads

92

Readme

当前版本只通用于“北京有生博大软件股份有限公司”的软件架构(v9.6+)中的SSO服务

当前版本:4.2.9

更新为 oidc 版本的 sso 插件,兼容原先的 oauth2.0 版本
登出时,走oidc的logoutURL 时,传id_token参数的KEY值,由原来的 "id_token" 改为 "id_token_hint"
自定义登出时,增设条件,外部不传完整的 logoutUrl,只传redirect_uri参数的方式,用于下一次单点登录时,指定跳转到某个工程页面
登出的 API 编码后再执行,避免复杂的参数拼接时,出现其它未知错误

y9plugin-sso 插件使用说明

版本说说明: vue2.x项目 对应插件版本2.x.yy
vue3.x项目 对应插件版本3.x.yy

main.js引入代码示例

import sso from "y9plugin-sso";
// 传入所需的环境变量
const env = {
    sso: {
        VUE_APP_SSO_DOMAINURL: import.meta.env.VUE_APP_SSO_DOMAINURL, // sso接口
        VUE_APP_SSO_CONTEXT: import.meta.env.VUE_APP_SSO_CONTEXT, // sso接口上下文
        VUE_APP_SSO_AUTHORIZE_URL: import.meta.env.VUE_APP_SSO_AUTHORIZE_URL, //sso授权码接口
        VUE_APP_SSO_LOGOUT_URL: import.meta.env.VUE_APP_SSO_LOGOUT_URL, //退出URL
        VUE_APP_SSO_CLIENT_ID: import.meta.env.VUE_APP_SSO_CLIENT_ID, //sso接口的固定字段
        VUE_APP_SSO_SECRET: import.meta.env.VUE_APP_SSO_SECRET, //sso接口的固定字段
        VUE_APP_SSO_GRANT_TYPE: import.meta.env.VUE_APP_SSO_GRANT_TYPE, //sso接口的固定字段
        VUE_APP_SSO_SITETOKEN_KEY: import.meta.env.VUE_APP_SSO_SITETOKEN_KEY, //sso-token_key
        // VUE_APP_REDISKEY: import.meta.env.VUE_APP_REDISKEY, //sso-redisKey
        // VUE_APP_SESSIONSTORAGE_GUID: import.meta.env.VUE_APP_SESSIONSTORAGE_GUID, //sso-sessionStorage_guid
        // VUE_APP_SERVER_REDIS: import.meta.env.VUE_APP_SERVER_REDIS //sso-redisServerUrl
    },
    logInfo: {
        showLog: true
    }
}

Vue.use(sso, {env});

其它

    具体使用说明文档查看:https://note.youdao.com/s/VZFo3N6D
    本地测试配置vue.config.js文件添加sso的代理
    vue2.x 仓库地址:https://www.npmjs.com/package/y9plugin-sso-v95

更新日志

3.0.1 用于 vite脚手架,不兼容vue-cli
3.0.3 修改工作流新开标签带参数无法跳转问题
3.0.4 增加了sso接口的上下文配置
3.0.5 修复了在没有登录的情况下,url带参数的跳转问题
3.0.6 修复了页面静止时,无任何操作时,计时最后半小时检测判断是否需要更新token和redis过期时间
3.0.7 修复了页面静止时,无任何操作时,强制更新token和redis过期时间
3.0.71 忘记干了啥
4.0.0 完全=4.0.5

4.0.4 给运维的同事专配的用于测试k8s

4.0.5 使用类重构插件,删除了redis中间件(最早使用localStorage存储时,是需要它的,后来更换为sessionStorage存储,可以不需要它)
4.0.7x 完全=4.0.5,只是稍微修改了一下这份说明文档
4.0.72 更新插件里的一个定时器bug
4.0.81  任意链接地址传参数时,合并参数缓存到本地
4.1.0  修复定时器更新token的bug
4.1.2  修复一个稳定新问题,福田-数字底座-生产环境打包结果的测试-谷歌浏览器,getAccessToken可能得到一个字符串,而不是一个对象
4.1.3 
     * 1、/oauth2.0/accessToken 需要 POST 请求,且参数以 form-data 方式提交
     * 2、redirect_uri 这个参数中不能有 code state response 这几个参数
     * 这两个调整内容都是*****由于新版本的 sso 增加的限制*****,
     * 这个修改应该都能兼容旧版本的 sso 服务端
4.1.4  修复定时器更新token的问题
4.1.5  删除package.json里的vue依赖
4.2.0  更新为 oidc 版本的 sso 插件,兼容原先的 oauth2.0 版本
4.2.1  更新为 无论是 oidc 还是 oauth2.0 版本,都有限尝试解 JWTtoken 的方式获取用户信息,否则使用原先的方式
     * 删除了 qs依赖,增加了jwt-decode依赖
4.2.2  修改ssoLogout登出时,传 id_token 参数的KEY值,由原来的 "id_token" 改为 "id_token_hint"
4.2.5  修复ssoLogout登出时,链接错误问题,sso插件增加一个clearCurrentSessionStorage方法,用于清除当前缓存并重载页面但不执行登出URL
4.2.6  暴露clearCurrentSessionStorage方法给外部程序调用
4.2.7  修改登出 URL 的post_logout_redirect_uri参数值,由原来的 "window.location.origin" 改为 "window.location.href"
4.2.8  删除登出 URL 的post_logout_redirect_uri参数值的斜杠,对 URL 编码后执行
4.2.9  自定义登出时,增设条件,外部不传完整的 logoutUrl,只传redirect_uri参数的方式,用于下一次单点登录时,指定跳转到某个工程页面