1.0.1 • Published 3 years ago

vue-auto-logout v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

English | 简体中文

vue-auto-logout NPM version

Project

The vue project with login function will be automatically logged out of the system if it has not been operated for a long time.The conditions are as follows:

  1. The Vue project of the Web on the PC side
  2. The system has a permission mechanism related to the login function
  3. The login identifiers such as token are stored in the browser arbitrary cache

Install

$ npm install vue-auto-logout
or
$ yarn add vue-auto-logout -S

Usage

main.js:

import { createApp } from 'vue'
import App from './app'
import logoutPlugin from 'vue-auto-logout'

const app = createApp(App)
const logoutOptions = {
  stagnateTime: 30 * 60 * 1000,
  detectTime: 30 * 60
}
app.use(logoutPlugin, logoutOptions)
app.mount('#app')

Logout Options

keydescriptiondefaultoptions
enableTurn on automatic logouttrueBoolean
keyNameThe key name of the token in the cachetokenString
clearAllWhether to clear all cached values ​​under this sitetrueBoolean
stagnateTimeNo operation dead time30minNumber
detectTimeHow many seconds to check whether to log out10sNumber
1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago