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

@yk-koi/sso

v1.4.0

Published

锦鲤sso登录

Readme

@yk-koi/sso

锦鲤sso登录集成说明, 这是旧版 推荐使用yk-sso

使用说明

安装

#安装
npm i @yk-koi/sso

使用

// 在main.js引入@koi/sso
import KOISSO from '@koi/sso'

// 在vue根节点初始化之前使用
KOISSO.init({
  // 接口请求地址,默认为:/
  baseUrl: process.env.VUE_APP_BASE_API,
  // caslogin登录地址前缀,默认为空
  CASE_LOGIN_PATH_PREFIX: '',
  // 锦鲤传递消息回调,接受锦鲤传来的除token外的信息会触发回调
  listenKoiMsg: () => { },
  // 锦鲤登录地址使用https协议,默认不使用
  useHttps: false
}).then(data => {
  // 这里data就是根据titck获取到的信息包含tgcd等
  // 这这里根据项目需求做一下登录后的操作,比如储存用户名,token之类的,和原有项目保持一致
  store.dispatch('user/loginSuccess', data).then(() => {
    // 信息设置完以后才渲染页面
    renderRootVue()
  })
}).catch(() => {
  // 根据ticket获取用户信息失败时,回退显示(根据项目设置,默认应该会显示登录页面),按自己需求看是否需要回退显示
  renderRootVue()
})
// 渲染页面
function renderRootVue() {
  new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
  })
}

// store的登录成功'user/loginSuccess'方法示例
// 注意:这里只是示例,实际使用按自己项目的需求来
async loginSuccess({ commit, dispatch }, userInfo) {
  commit('set_authorities', userInfo.authorities)
  commit('SET_NAME', userInfo.username)
  setToken(userInfo.tgc)
  sessionStorage.setItem('VSRUSER', JSON.stringify(userInfo))
  // 挂载路由
  const accessRoutes = await dispatch('permission/generateRoutes', userInfo.authorities, { root: true })
  router.addRoutes(accessRoutes)
}

401及退出登录处理

// 退出登录是需调用KOISSO.loginOut(),视项目情况自行修改