Sync with backend
This commit is contained in:
		
							parent
							
								
									1d598b5787
								
							
						
					
					
						commit
						bdcf9668b7
					
				| 
						 | 
				
			
			@ -16,9 +16,13 @@ export default boot(({ Vue }) => {
 | 
			
		|||
    if (H.length == 1) H = `0${H}`;
 | 
			
		||||
    let M = date.getMinutes().toString();
 | 
			
		||||
    if (M.length == 1) M = `0${M}`;
 | 
			
		||||
    let S = ''
 | 
			
		||||
    let S = '';
 | 
			
		||||
    if (seconds) {
 | 
			
		||||
        S = ':' + (date.getSeconds() > 9 ? date.getSeconds().toString() : `0${date.getSeconds().toString()}`);
 | 
			
		||||
      S =
 | 
			
		||||
        ':' +
 | 
			
		||||
        (date.getSeconds() > 9
 | 
			
		||||
          ? date.getSeconds().toString()
 | 
			
		||||
          : `0${date.getSeconds().toString()}`);
 | 
			
		||||
    }
 | 
			
		||||
    return `${H}:${M}${S} ${formatDate(date)}`;
 | 
			
		||||
  });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ declare namespace FG {
 | 
			
		|||
    firstname: string;
 | 
			
		||||
    lastname: string;
 | 
			
		||||
    mail: string;
 | 
			
		||||
    roles: Array<Role>;
 | 
			
		||||
    roles: Array<string>;
 | 
			
		||||
  }
 | 
			
		||||
  type Permission = string;
 | 
			
		||||
  interface Role {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ import { defineComponent, ref } from '@vue/composition-api';
 | 
			
		|||
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
  // name: 'PageName'
 | 
			
		||||
  setup(_, ctx) {
 | 
			
		||||
  setup(_, { root }) {
 | 
			
		||||
    const userid = ref('');
 | 
			
		||||
    const password = ref('');
 | 
			
		||||
    const rules = [
 | 
			
		||||
| 
						 | 
				
			
			@ -46,8 +46,7 @@ export default defineComponent({
 | 
			
		|||
    ];
 | 
			
		||||
 | 
			
		||||
    function doLogin() {
 | 
			
		||||
      console.log(userid.value, password.value);
 | 
			
		||||
      ctx.root.$store
 | 
			
		||||
      root.$store
 | 
			
		||||
        .dispatch('session/login', {
 | 
			
		||||
          userid: userid.value,
 | 
			
		||||
          password: password.value
 | 
			
		||||
| 
						 | 
				
			
			@ -55,7 +54,6 @@ export default defineComponent({
 | 
			
		|||
        .catch(error => {
 | 
			
		||||
          console.warn(error);
 | 
			
		||||
        });
 | 
			
		||||
      //ctx.root.$router.push({ name: 'main' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return { userid, password, doLogin, rules };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,4 +6,10 @@ export interface LoginData {
 | 
			
		|||
export interface LoginResponse {
 | 
			
		||||
  user: FG.User;
 | 
			
		||||
  session: FG.Session;
 | 
			
		||||
  permissions: FG.Permission[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
 | 
			
		||||
export interface CurrentUserResponse extends FG.User {
 | 
			
		||||
  permissions: FG.Permission[];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue