2023-07-15 15:03:08 +07:00
|
|
|
<template>
|
2023-09-01 03:10:33 +07:00
|
|
|
<v-app>
|
|
|
|
<v-container class="d-flex justify-center align-center">
|
2023-11-24 11:32:54 +07:00
|
|
|
<div v-if="!currentUser">
|
2023-09-01 03:55:00 +07:00
|
|
|
<h1>ยังไม่ได้ลงชื่อเข้าใช้</h1>
|
|
|
|
<h2>ลงชื่อเข้าใช้เพื่อบันทึกการตั้งค่าอย่างปลอดภัย</h2>
|
2023-09-01 03:10:33 +07:00
|
|
|
<v-container class="d-flex justify-center align-center">
|
|
|
|
<v-btn class="ma-2" width="150" :to="{name: 'login'}">ลงชื่อเข้าใช้</v-btn>
|
2023-09-30 20:01:47 +07:00
|
|
|
<v-btn class="ma-2" width="150" :to="{name: 'register'}">สมัครสมาชิก</v-btn>
|
2023-09-01 03:10:33 +07:00
|
|
|
</v-container>
|
|
|
|
</div>
|
|
|
|
</v-container>
|
2023-08-02 03:15:33 +07:00
|
|
|
<v-sheet class="d-flex justify-center ma-2">
|
|
|
|
<v-sheet class="mb-auto"
|
|
|
|
max-width="420px"
|
|
|
|
min-width="200px"
|
|
|
|
width="95vw">
|
|
|
|
<v-list class = "ma-2" density="compact">
|
|
|
|
<v-list-subheader>การแสดงผล</v-list-subheader>
|
|
|
|
|
|
|
|
<v-list-item
|
|
|
|
v-for="(item, i) in display_items"
|
|
|
|
:key="i"
|
|
|
|
:value="item"
|
|
|
|
>
|
|
|
|
|
|
|
|
<v-list-item-title v-text="item.text"></v-list-item-title>
|
|
|
|
</v-list-item>
|
|
|
|
</v-list>
|
|
|
|
|
|
|
|
<v-list class = "ma-2" density="compact">
|
|
|
|
<v-list-subheader>การนำทาง</v-list-subheader>
|
|
|
|
|
|
|
|
<v-list-item
|
|
|
|
v-for="(item, i) in navigation_items"
|
|
|
|
:key="i"
|
|
|
|
:value="item"
|
|
|
|
>
|
|
|
|
|
|
|
|
<v-list-item-title v-text="item.text"></v-list-item-title>
|
|
|
|
</v-list-item>
|
|
|
|
</v-list>
|
|
|
|
|
|
|
|
<v-list class = "ma-2" density="compact">
|
|
|
|
<v-list-item
|
|
|
|
v-for="(item, i) in about_items"
|
|
|
|
:key="i"
|
|
|
|
:value="item"
|
2023-08-21 18:14:03 +07:00
|
|
|
:to="{name: 'about'}"
|
2023-08-02 03:15:33 +07:00
|
|
|
>
|
|
|
|
<template v-slot:append>
|
|
|
|
<v-icon :icon="item.icon"></v-icon>
|
|
|
|
</template>
|
|
|
|
<v-list-item-title v-text="item.text"></v-list-item-title>
|
|
|
|
</v-list-item>
|
|
|
|
</v-list>
|
|
|
|
|
2023-11-18 18:06:27 +07:00
|
|
|
<v-btn @click.prevent="logout" class = "ma-2 mt-3" width="100%"
|
2023-08-02 03:15:33 +07:00
|
|
|
color="red">
|
|
|
|
ลงชื่อออก
|
|
|
|
</v-btn>
|
|
|
|
</v-sheet>
|
|
|
|
|
2023-09-01 03:10:33 +07:00
|
|
|
</v-sheet>
|
|
|
|
</v-app>
|
2023-07-21 16:43:20 +07:00
|
|
|
|
2023-07-15 15:03:08 +07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2023-08-02 03:15:33 +07:00
|
|
|
|
2023-08-21 18:14:03 +07:00
|
|
|
import {RouterLink} from 'vue-router';
|
2023-11-18 18:06:27 +07:00
|
|
|
import { VContainer } from 'vuetify/lib/components/index.mjs';
|
|
|
|
import router from '@/plugins/router'
|
2023-08-21 18:14:03 +07:00
|
|
|
|
2023-08-02 03:15:33 +07:00
|
|
|
const account_items = [
|
2023-09-01 03:10:33 +07:00
|
|
|
{ text: 'ตั้งค่าบัญชี',
|
|
|
|
icon: 'mdi-chevron-right'},
|
2023-07-21 17:02:23 +07:00
|
|
|
|
2023-08-02 03:15:33 +07:00
|
|
|
]
|
|
|
|
|
|
|
|
const display_items = [
|
|
|
|
{ text: 'ภาษา'},
|
|
|
|
{ text: 'ธีม' },
|
|
|
|
]
|
|
|
|
|
|
|
|
const navigation_items = [
|
|
|
|
{ text: 'โหมดเริ่มต้น'},
|
|
|
|
]
|
|
|
|
|
|
|
|
const about_items = [
|
2023-09-01 03:10:33 +07:00
|
|
|
{ text: 'เกี่ยวกับ',
|
|
|
|
icon: 'mdi-chevron-right',}
|
2023-08-02 03:15:33 +07:00
|
|
|
]
|
|
|
|
|
2023-11-18 18:06:27 +07:00
|
|
|
function logout() {
|
|
|
|
if (sessionStorage.getItem('current_user')){
|
|
|
|
console.log('loging out...');
|
|
|
|
fetch(`https://little-lines-backend.techtransthai.org/api/users/logout`, {
|
|
|
|
method: "GET"
|
|
|
|
}).then(()=>{
|
|
|
|
console.log('loged out');
|
|
|
|
sessionStorage.removeItem('current_user');
|
|
|
|
router.push({ name: 'home' });
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2023-08-02 03:15:33 +07:00
|
|
|
|
2023-07-21 17:31:43 +07:00
|
|
|
</script>
|
2023-11-24 11:32:54 +07:00
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentUser: JSON.parse(sessionStorage.getItem('current_user'))
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|