yzs-login-component-fast

0.2.1 • Public • Published

portalCode 门户编码,必传

isLocalStorage 是否是isLocalStorage存储,默认是true,false为sessionStorage存储

tokenName 存储用户中心token的名称,默认为iamToken

userInfoName 存储用户中心登录人员信息的名称,默认为iamUserInfo

menuName 存储用户中心权限菜单的名称,默认为iamMenuList

isShowAccountLogin 是否使用账号密码登录,默认是true

themeColor 主题色,默认蓝色

引入

npm i yzs-login-component-fast

main.js中引入文件

import YzsLoginComponentFast from 'yzs-login-component-fast'
import 'yzs-login-component-fast/lib/yzs-login-component-fast.css'
Vue.use(YzsLoginComponentFast)

组件中直接使用

<template>
    <div class="main">
       <YzsLoginComponentFast :portalCode="'YZS_IAM'" :themeColor="'#faad14'" :isLocalStorage="false" :menuName="'list'" :tokenName="'token'" />
    </div>
</template>

loginSuccess为登录成功后的回调,可以做一些路由跳转的逻辑处理

 methods: {
        loginSuccess () {
            this.$router.push({path: 'xxx'})
            ...
        }
 }

存储的数据,默认存储在localStorage中,名称也是默认的,存储方式和存储名称可自己传入

 iamToken:获取的token
 iamUserInfo: 登录用户信息
 iamMenuList:权限菜单

 建议自己项目的vue-router使用3.5.2

Readme

Keywords

none

Package Sidebar

Install

npm i yzs-login-component-fast

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

10.8 MB

Total Files

25

Last publish

Collaborators

  • zgq1014