0.0.3 • Published 5 years ago

vue-cloud v0.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

vue-cloud

vue-cloud vue单页页面登录拦截模拟插件,简单易用

使用

import cloud from "./api/cloud";

cloud.init('http://localhost:8080');

// 模拟数据
cloud.mock(mock);

路由加入

import cloud from "./api/cloud";


router.beforeEach((to, from, next) => {
  //过滤不需要验证的路由
  if (to.matched.some(recode => recode.meta.noAuth)) {
    next();
    return;
  }

  //微信登录鉴权
  cloud.login(to, next, res => {
    console.log(res);
  });
});
0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago