1.0.0 • Published 2 years ago

yzs-track-map v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

portalCode 门户编码,必传

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

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

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

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

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

themeColor 主题色,默认蓝色

引入

npm i yzs-login-component

main.js中引入文件

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

组件中直接使用

<template>
    <div class="main">
       <YzsLoginComponent :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