1.2.2-beta.0 • Published 3 years ago
vue-hamlet v1.2.2-beta.0
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
toaxios
. - 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
3 years ago
1.0.9
3 years ago
1.0.10
3 years ago
1.0.9-beta.0
3 years ago
1.2.1-beta.1
4 years ago
1.2.0-beta.0
5 years ago
1.1.2-beta.0
5 years ago
1.1.0
5 years ago
1.0.8
5 years ago
1.0.6
6 years ago
1.0.5
7 years ago
1.0.5-rc.5
7 years ago
1.0.5-rc.4
7 years ago
1.0.5-rc.3
7 years ago
1.0.5-rc.2
7 years ago
1.0.5-rc.1
7 years ago
1.0.2-rc.0
7 years ago
1.0.2
7 years ago