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

qlfy-unified-login

v1.1.8

Published

实现统一认证登陆功能的逻辑插件,无实际渲染标签,内置统一登陆跳转、统一登录token获取、统一登陆token刷新等功能;

Readme

简介

实现统一认证登陆功能的逻辑插件,无实际渲染标签,内置统一登陆跳转、统一登录token获取、统一登陆token刷新等功能;

当token在指定时间内无更新时,会自动刷新本地token数据;

仅可在全局范围内加载使用(app.vue),全局仅可使用一次,多次使用,仅第一次使用有效;

组件参数

| 属性名 | 说明 | 类型 | 默认值 | | ------------------- | ------------------------------------------------------------ | ---------------------------------- | -------------- | | clientId | 应用id,统一认证平台提供,必填 | | —— | | clientSecret | 应用秘钥,统一认证平台提供,必填 | | —— | | useRouter | 路由对象,传入vue-Router的useRouter()值 | Router | —— | | loginInfo | 统一认证的登录信息,如传入该值,则不触发登陆,直接使用传入的用户信息,非必填 | LoginInfo | —— | | networkType | 网络环境类型配置 | 'LAN'|'INT'(内网环境|外网环境) | 'LAN' | | isEnabled | 是否启用组件,支持动态控制 | boolean | true | | listenToken | 是否实时监听token状态100ms检测一次token是否存在,丢失触发重新获取 | boolean | false | | refreshTokenOnRoute | 是否开启路由变动时自动刷新token功能开启后,每次路由变动延时2s自动刷新token | boolean | false | | redirectPath | 统一登陆成功后,跳转的地址;如不设置,默认跳转至触发登陆的页面 | string | ‘’ | | tokenName | local中保存token值的键名称 | string | 'access_token' | | refreshInterval | token自动更新的时间间隔,单位秒 | number | 600 | | tokenValidity | token过期时间,单位秒 | number | 1800 | | getTokenUrl | 获取token的请求地址默认根据networkType自动获取内网为:http://10.76.91.87:28080外网为:http://10.76.44.44:28080 | string | —— | | getCodeUrl | 获取code的跳转地址默认根据networkType自动获取内网为:http://sd.uts.cma:18010外网为:https://58.59.29.50:13019 | string | —— |

组件事件

| 事件名 | 说明 | 类型 | | ------------ | ------------------------------------------- | -------------------------------------- | | loginSuccess | 初次加载,登陆信息成功后触发该事件 | Function:( loginInfo:Object ) => void | | tokenChange | token刷新时,触发该事件首次登陆不触发 | Function:( loginInfo:Object ) => void | | loggingIn | 从统一认证平台返回后触发该事件 | Function:( ) => void |

暴露内容

| 方法名 | 说明 | 类型 | | --------------- | --------------------------- | -------------------- | | refreshToken | 手动刷新登陆状态,更新token | Function:()=>void | | logout | 退出登陆 | Function:()=>void | | getUnifiedToken | 获取当前使用的token | Function:()=>string | | getLoginInfo | 获取当前登录信息 | Function:()=>Object |

组件工具库

可在任意位置导入并使用该工具库内的方法,实现相关操作功能

导入方法 :

import {xxx} from '***/qlUnifiedLogin/tools.js'

| 方法名 | 说明 | 类型 | | --------------- | ---------------------------------------------- | -------------------- | | logout | 退出登陆 | Function:()=>void | | getUnifiedToken | 获取当前使用的token | Function:()=>string | | getLoginInfo | 获取当前登录信息 | Function:()=>Object | | refreshToken | 刷新token的方法,刷新成功后触发tokenChange事件 | Function:()=>void |