[修改]
个人中心退出登录样式修改,添加身份
This commit is contained in:
@@ -24,7 +24,10 @@
|
|||||||
<div class="user-actions">
|
<div class="user-actions">
|
||||||
<template v-if="userStore.isAuthenticated">
|
<template v-if="userStore.isAuthenticated">
|
||||||
<span class="username">{{ userStore.user?.username || '用户' }}</span>
|
<span class="username">{{ userStore.user?.username || '用户' }}</span>
|
||||||
<button class="logout-btn" @click="handleLogout">退出登录</button>
|
<div class="user-role">
|
||||||
|
<el-tag type="primary">代理</el-tag>
|
||||||
|
</div>
|
||||||
|
<!-- <button class="logout-btn" @click="handleLogout">退出登录</button>-->
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="auth-buttons">
|
<div class="auth-buttons">
|
||||||
@@ -112,6 +115,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="userStore.isAuthenticated" class="option-section" style="">
|
||||||
|
<el-button @click="handleLogout" type="danger" class="option-btn" plain>退出登录</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 头像上传对话框 -->
|
<!-- 头像上传对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="showAvatarUpload"
|
v-model="showAvatarUpload"
|
||||||
@@ -401,9 +408,9 @@ export default {
|
|||||||
await ElMessageBox.confirm('确定要退出登录吗?', '提示', {
|
await ElMessageBox.confirm('确定要退出登录吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning',
|
||||||
|
lockScroll: false
|
||||||
});
|
});
|
||||||
|
|
||||||
userStore.logout();
|
userStore.logout();
|
||||||
router.push('/mylogin');
|
router.push('/mylogin');
|
||||||
ElMessage.success('已退出登录');
|
ElMessage.success('已退出登录');
|
||||||
@@ -562,6 +569,7 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-buttons {
|
.auth-buttons {
|
||||||
@@ -818,6 +826,26 @@ export default {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.option-section {
|
||||||
|
margin-top: 20px;
|
||||||
|
|
||||||
|
.option-btn {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #ff4d4f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-btn:hover {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-btn:active {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 头像上传对话框样式 */
|
/* 头像上传对话框样式 */
|
||||||
.avatar-uploader {
|
.avatar-uploader {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user