npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-admin-evo

v3.0.0

Published

##### URL 跳转回跳参数为 oauth_callback

Downloads

163

Readme

所有项目约定

URL 跳转回跳参数为 oauth_callback
URL 带 token 参数为 __token
路由约定
      {
        path: '/page-a',
        name: 'page-a',
        meta: {
          icon: '', // 当前菜单icon,antd icon组件
          name: 'page-a', // 当前菜单及面包屑名称
          hidden: true, // 是否显示当前菜单,默认false显示
          skipLogin: true, // 是否验证token, 默认false验证
          activeMenu:'', //当前路由高亮选中菜单,不设置默认高亮当前路由匹配的菜单
          breadHidden: false, //是否隐藏当前面包屑,默认false显示
          breadcrumb: undefined // 是否自定义当前面包屑[{icon:'',name:'',path:''}],
        },
        component: PageA,
        children: []
      },

组件介绍

export { AdminLayout, BlankLayout, Request, client, socket };
AdminLayout、BlankLayout 为框架级组件
AdminLayout 带头部导航和左侧菜单,
需要传入 appName,表示当前项目名称
  props: {
    appName: {
      type: String,
      require,
      default: ''
    }
  },
BlankLayout 为空白页面

client 是实例化后的 Axios,可以直接使用,如需特殊需求,使用 Request 自行封装
import { client } from 'vue-admin-evo';

async function getData() {
  const res = await client.get('/data')
  console.log(res)
}

socket 是实例化后的 socket.io 客户端,提供了 connentSocket 方法连接 socket 客户端,连接参数为
{
  ns: string;
  token: string;
  url: string;
}
import { socket,connectSocket } from 'vue-admin-evo';
socket.on('name', res => {
  console.log(res)
})

自动注入名为 evo 的 Module
export interface UserInfo {
  ws_token: { ns: string; token: string };
  avatar: string;
  id: number;
  navigation: {
    key: string;
    text: string;
    url: string;
  }[];
  token: string;
}

export interface EvoState {
  userInfo: UserInfo;
}
state: {
  userInfo: {}
}

mutations = {
  setUserInfo(state, payload) {
    state.userInfo = payload;
  }
}

提供了统一的 router.beforeEach,router.afterEach 进行 token 校验

使用方法

import Evo from 'vue-admin-evo';
import 'vue-admin-evo/dist/vue-admin-evo.css';
Vue.use(Evo, {
  store, //传入store
  router, // 传入router
  logoutURL: '/v2/admin/login-out',
  wsBaseURL: '',
  loginHost: process.env.VUE_APP_LOGIN_URL, // 登录项目域名
  clientBaseURL: process.env.VUE_APP_API_BASE_URL, // 接口根域名
  userInfoPath: '/v2/admin/userinfo', // 获取用户信息接口路径
  onlineStatusPath: '/v2/admin/online-state', // 上下线接口路径
  $message: Vue.prototype.$message, // message组件
  $modal: Modal, // modal组件
  Moment: Moment // Moment
});