Socket
Socket
Sign inDemoInstall

@midcu/vue-auth

Package Overview
Dependencies
45
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @midcu/vue-auth

一个基于vue的前端权限框架依赖包,包括菜单用户角色权限管理


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue-auth

一个基于vue的前端框架插件,包括权限验证用户管理角色管理菜单管理权限管理等功能。

项目demo,用户密码:admin:123
依靠vue-auth可以迅速的搭建起一个新的管理系统

安装使用

npm install -S @midcu/vue-auth element-ui axios

配置

框架依赖vuex作为全局状态管里,vue-router作为路由跳转控制,Axios作为HTTP请求工具,ElementUi作为UI框架

可配置内容,详见config,其他配置可详见项目的具体代码
import Axios from 'axios'
import Auth from '@midcu/vue-auth'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(ElementUI)

const request = Axios.create({
  baseURL: '/api',
  timeout: 30000
})

Vue.use(Auth, {
    router, //vue-router的实例
    loader: (name) => import('./views/'+name), // [name].vue页面懒加载的函数
    store, // vuex的实例
    request,// Axios的实例
    { } // config 插件的配置,覆盖默认配置
})

new Vue({
    router,
    store,
    render: (h) => h("va-main")
}).$mount('#app')

运行测试

建议使用vue-cli搭建vue项目(ps:运行前清除原有的route地址)。

配置相应的后台地址。

运行项目即可看到管理系统

Keywords

FAQs

Last updated on 10 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc