mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.0 KiB
HTML
56 lines
1.0 KiB
HTML
|
7 months ago
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
|
||
|
|
<style>
|
||
|
|
.logout-btn {
|
||
|
|
padding: 5px 10px;
|
||
|
|
background: #fff;
|
||
|
|
color: #1e88e5;
|
||
|
|
border: none;
|
||
|
|
border-radius: 4px;
|
||
|
|
cursor: pointer;
|
||
|
|
transition: all 0.2s;
|
||
|
|
}
|
||
|
|
|
||
|
|
.logout-btn:hover {
|
||
|
|
background: #f5f5f5;
|
||
|
|
}
|
||
|
|
|
||
|
|
.header-user {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
gap: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.user-avatar {
|
||
|
|
width: 32px;
|
||
|
|
height: 32px;
|
||
|
|
border-radius: 50%;
|
||
|
|
object-fit: cover;
|
||
|
|
}
|
||
|
|
|
||
|
|
.user-name {
|
||
|
|
font-size: 14px;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
|
||
|
|
<body>
|
||
|
|
<div class="header-user ml-auto" v-if="user.name">
|
||
|
|
<img :src="user.icon" class="user-avatar" alt="用户头像">
|
||
|
|
<a href='/profile' class="user-name">{{ user.name }}</a>
|
||
|
|
<v-btn size='sm' color='#f1acac' typ='outline' @click="token.logout($env.root)" class="logout-btn">
|
||
|
|
退出
|
||
|
|
</v-btn>
|
||
|
|
</div>
|
||
|
|
<div class="header-user" v-else>
|
||
|
|
<span>未登录</span>
|
||
|
|
<a :href="'/login'" class="logout-btn">
|
||
|
|
登录
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
<script setup>
|
||
|
|
import token from 'token'
|
||
|
|
user = token.body() || {}
|
||
|
|
</script>
|