Profil, merge Master and corrections
This commit is contained in:
		@ -2,6 +2,7 @@
 | 
			
		||||
  import { toast } from 'vue3-toastify';
 | 
			
		||||
  import { ref, computed } from 'vue'
 | 
			
		||||
  import i18n, { setLang } from './i18n.js'
 | 
			
		||||
  import { isLogged } from '@/rest/Users.js'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  // Liste des apps
 | 
			
		||||
@ -23,6 +24,7 @@
 | 
			
		||||
  const currentPath = ref(window.location.hash)
 | 
			
		||||
 | 
			
		||||
  window.addEventListener('hashchange', () => {
 | 
			
		||||
	Logged.value = isLogged();
 | 
			
		||||
    currentPath.value = window.location.hash
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
@ -35,7 +37,9 @@
 | 
			
		||||
  const settings=ref(i18n("app.settings"))
 | 
			
		||||
  const login=ref(i18n("app.login"))
 | 
			
		||||
  const active=ref(false)
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  const Logged = ref(isLogged());
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
@ -49,11 +53,11 @@
 | 
			
		||||
            </a></li>
 | 
			
		||||
        <li title=home>
 | 
			
		||||
            <a class="icon" href="#home">
 | 
			
		||||
                <div class=" fa-solid fa-house" style="margin-top: 7px; margin-bottom: 3px;"></div>
 | 
			
		||||
				<div class=" fa-solid fa-house" style="margin-top: 7px; margin-bottom: 3px;"></div>
 | 
			
		||||
            </a></li>
 | 
			
		||||
        <li style="float: right;" title=login>
 | 
			
		||||
            <a class="icon" href="#/login">
 | 
			
		||||
                <div class="fa-solid fa-user"  style="margin-top: 7px; margin-bottom: 3px;"></div>
 | 
			
		||||
                <div class="fa-solid fa-user" :style="Logged ? 'color: orange' : 'haha'" style="margin-top: 7px; margin-bottom: 3px; "></div>
 | 
			
		||||
            </a></li>
 | 
			
		||||
        <li style="float: right;" title=notifications>
 | 
			
		||||
            <a class="icon" href="#Notifications">
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
<script setup>
 | 
			
		||||
  import { ref } from 'vue'
 | 
			
		||||
  import i18n from '@/i18n.js'
 | 
			
		||||
  import { login , register } from '@/rest/Users.js'
 | 
			
		||||
  import { login , register , disconnect} from '@/rest/Users.js'
 | 
			
		||||
  import { getAllCurriculums } from '@/rest/curriculum.js'
 | 
			
		||||
  import { uploadProfilePicture } from '@/rest/uploads.js'
 | 
			
		||||
  import {toast} from 'vue3-toastify'
 | 
			
		||||
@ -42,6 +42,8 @@
 | 
			
		||||
    return toast('Password and Confirm Password are different',{type: "error",});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  disconnect()
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -125,7 +125,7 @@ function getPP(){
 | 
			
		||||
        <div>
 | 
			
		||||
        </div>
 | 
			
		||||
    
 | 
			
		||||
      <div v-if="(user.role=='teacher')">
 | 
			
		||||
      <div v-if="(user.role==='Teacher')">
 | 
			
		||||
          <div class="listTitle">
 | 
			
		||||
            {{i18n("profile.course.list")}}
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,18 @@
 | 
			
		||||
import { restGet, restPost } from './restConsumer.js'
 | 
			
		||||
import { getCookie, setCookie } from '@/utils.js'
 | 
			
		||||
 | 
			
		||||
export async function login(user, pass, exp){
 | 
			
		||||
	return restPost("/login", {identifier: user, password: pass, expirationDate: exp});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function isLogged(){
 | 
			
		||||
	return getCookie("session_token") != "" 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function disconnect(){ 
 | 
			
		||||
	setCookie("session_token", ";expires= Thu, 01 Jan 1970 00:00:01 GMT")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Register a user (tokenless)
 | 
			
		||||
 * 
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								frontend/src/rest/apps.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								frontend/src/rest/apps.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
import { restGet } from './restConsumer.js' 
 | 
			
		||||
 | 
			
		||||
export async function appList(){
 | 
			
		||||
	return restGet("/apps")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function checkPage(page){
 | 
			
		||||
	return restGet("/apps/" + page)
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user