Explorar o código

minor bug fix

Nivek %!s(int64=2) %!d(string=hai) anos
pai
achega
a67a1fca1c
Modificáronse 1 ficheiros con 12 adicións e 8 borrados
  1. 12 8
      src/components/Dashboard.vue

+ 12 - 8
src/components/Dashboard.vue

@@ -13,18 +13,22 @@
   onMounted(() => {
   onMounted(() => {
 
 
 
 
-    const res = axios.get('/users', {
+    const res = axios.get('/api/users', {
       headers: {token: document.cookie.split(";")[0].split("=")[1]}
       headers: {token: document.cookie.split(";")[0].split("=")[1]}
-    })
+    }).then(res => {
+      console.log(document.cookie.split(";")[0].split("=")[1])
+
+      console.log(res)
 
 
-    console.log(document.cookie.split(";")[0].split("=")[1])
+      name.value = res.data.result.name
+      tel.value = res.data.result.phone
+      address.value = res.data.result.address
+
+      const isCustomer = (res.data.result.role == 'CUSTOMER')
+      const isStaff = (res.data.result.role == 'STAFF')
+    })
 
 
-    name.value = res.data.name
-    tel.value = res.data.phone
-    address.value = res.data.address
 
 
-    const isCustomer = (res.data.role == 'CUSTOMER')
-    const isStaff = (res.data.role == 'STAFF')
   })
   })
 
 
 </script>
 </script>