transfer to mac

This commit is contained in:
Tim Gröger 2020-10-15 11:23:41 +02:00
parent 01afa232c4
commit 1ad39f386e
3 changed files with 58 additions and 0 deletions

View File

@ -11,3 +11,5 @@ export default boot(({ Vue }) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Vue.prototype.$axios = axios;
});
export { axios };

View File

@ -0,0 +1,4 @@
export interface LoginData {
userid: string;
password: string;
}

View File

@ -0,0 +1,52 @@
import { Module, MutationTree, ActionTree, Commit } from 'vuex';
import { StateInterface } from 'src/store';
import { axios } from 'boot/axios';
import { LoginData } from 'src/plugins/user/models'
export interface Token {
browser: string;
expires: string;
lifetime: number;
platform: string;
token: string;
}
export interface User {
display_name: string | null;
firstname: string;
lastname: string;
mail: string;
roles: string[];
}
export interface UserStateInterface {
permissions: string[];
token: Token;
user: User;
userid: string;
}
const state: UserStateInterface = {
permissions: [],
token: { browser: '', expires: '', lifetime: -1, platform: '', token: '' },
user: {
display_name: '',
firstname: '',
lastname: '',
mail: '',
roles: []
},
userid: ''
};
const mutation: MutationTree<UserStateInterface> = {
setState(state: UserStateInterface, data: UserStateInterface) {
state = data;
}
};
const actions: ActionTree<UserStateInterface, StateInterface> = {
async = login({ commit: Commit }, data: LoginData) {
axios
}
};