vue-token-login icon indicating copy to clipboard operation
vue-token-login copied to clipboard

a login demo usedof vue &&token

vue-token-login

使用 vue + token 的登录 demo

  • 首次登录,发送账号密码给后端
  • 后端根据秘钥 + username + 过期时间生成 Token,返回给前端
  • 前端拿到之后存储在 localStroage 和 Vuex 中
  • 每次发送请求在 header 里添加 Token

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run all tests
npm test

For a detailed explanation on how things work, check out the guide and docs for vue-loader.