# 登录 **Repository Path**: yulin-road-shoulder/login ## Basic Information - **Project Name**: 登录 - **Description**: No description available - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-19 - **Last Updated**: 2025-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # kst-auth ## 安装 ``` yarn add vue-kst-auth ``` ## 导出说明 ``` export { Login as default, _axios, baseConfig }; Login // 登录组件 _axios // 封装后的axios 自定义headers,返回数据的过滤 baseConfig // 基础数据(登录状态等) ``` ### 使用 ``` import Login from "vue-kst-auth" const router = new VueRouter( { mode: 'history', routes: [ { path: '/login', name: 'Login', component: Login }, { path: '/', name: 'Home', component: home} ] } ) ``` ``` 在main.ts中 import { _axios, baseConfig } from "vue-kst-auth" // 可以将_axios作为vue全局属性来使用 Vue.prototype.$axios = _axios; 在组建中能够直接使用,请求会添加headers信息 this.$axios.get("").then(res => {}) this.$axios.post("").then(res => {}) ``` ``` 在组件中使用vue-kst-auth中的属性的方法 import { baseConfig } from "vue-kst-auth"; baseConfig.getLoginState() // 获取登录状态 baseConfig.setLoginTitle("登录显示的单位名称"); baseConfig.setLoginUrl("设置登录地址"); ...等 ```