2023-03-14 14:33:06 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<h1>Index</h1>
|
|
|
|
<p>Index page</p>
|
|
|
|
<p>Current time: {{ time }}</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<p>用户名: {{ user.name }}</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
import http from '../plugins/http'
|
|
|
|
const time = ref(new Date().toLocaleTimeString());
|
|
|
|
|
|
|
|
|
|
|
|
const user = ref({
|
|
|
|
name: 'loading...'
|
2023-03-15 13:43:13 +00:00
|
|
|
|
2023-03-14 14:33:06 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
http.get('user').then((res) => {
|
|
|
|
user.value = res.data
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2023-03-15 13:43:13 +00:00
|
|
|
http.get('tunnels').then((res) => {
|
|
|
|
console.log(res.data)
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2023-03-14 14:33:06 +00:00
|
|
|
</script>
|