transfer to mac
This commit is contained in:
parent
01afa232c4
commit
1ad39f386e
|
@ -11,3 +11,5 @@ export default boot(({ Vue }) => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
Vue.prototype.$axios = axios;
|
||||
});
|
||||
|
||||
export { axios };
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
export interface LoginData {
|
||||
userid: string;
|
||||
password: string;
|
||||
}
|
|
@ -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
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue