1.2.2-beta.0 • Published 2 years ago

vue-hamlet v1.2.2-beta.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

Vue Hamlet

vue-hamlet is used as authentication for frontend.

Index

Install

Install repository into your project.

> npm install yimian/vue-hamlet --save-dev

Configure setting in your project main.js

import Axios from 'axios';
import { sync } from 'vuex-router-sync';
import auth from 'vue-hamlet';
import router from './router';
import store from './store';

Vue.prototype.$http = Axios;
Vue.store = store;
Vue.router = router;

Vue.use(auth, {
  fetchUser: '',
  appKey: '',
});

sync(store, router);

:white_check_mark: TODO

  • mod: change VueResource to axios.
  • add: change password function.
  • add: consts(constants) file.

Demo

Run demo project with following procedures:

cd demo/
npm install
npm run dev

Configuration

Default Configuration:

fetchUser: '/api/auth/me',
appKey: '',
authType: 'Bearer',
hamletPrefix: '/api/auth',
authRedirect: '/login',
refreshInterval: 10, // mins
forbiddenRedirect: '/403',
notFoundRedirect: '/404',

You can rewrite default configuration in your project like:

Vue.use(auth, {
  appKey: '',
});

You can get the common error reason from $auth.consts.

1.2.2-beta.0

2 years ago

1.0.9

2 years ago

1.0.10

2 years ago

1.0.9-beta.0

2 years ago

1.2.1-beta.1

3 years ago

1.2.0-beta.0

4 years ago

1.1.2-beta.0

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.5-rc.5

6 years ago

1.0.5-rc.4

6 years ago

1.0.5-rc.3

6 years ago

1.0.5-rc.2

6 years ago

1.0.5-rc.1

6 years ago

1.0.2-rc.0

6 years ago

1.0.2

6 years ago