mo 2 rokov pred
rodič
commit
8375e4636d

+ 12 - 1
src/components/col-header/modals/loganInfo.tsx

@@ -16,6 +16,7 @@ import peopleIcon from '../images/peopleIcon.png'
 import planIcon from '../images/planIcon.png'
 import { getUserInfo, getUserType, getAuth, setAuth } from '@/helpers/utils'
 import { useRouter } from 'vue-router'
+import request from '@/helpers/request'
 export default defineComponent({
   name: 'loganInfo',
 
@@ -71,7 +72,17 @@ export default defineComponent({
         window.location.reload()
       })
     }
-    const logout = () => {}
+    const logout = async () => {
+      try{
+        const res = await request.get('/api-website/exit', {
+
+        })
+        router.push({ path: '/' })
+        window.location.reload()
+      }catch(e){
+        console.log(e)
+      }
+    }
     const changeState = (val: string) => {
       if (val == 'strudent') {
         gotoPage('/studentInfo')