-- bug 登出

This commit is contained in:
yuping
2022-12-03 18:53:38 +08:00
parent 16aec52764
commit db610d81c1
4 changed files with 151 additions and 119 deletions

View File

@@ -2,8 +2,8 @@
<div class="navTop">
<div class="navTopMain">
<img
style="width: 205px; height: 29px; margin-left: 37px; margin-top: 22px"
src="../assets/images/navtop/logo.png"
style="width: 205px; height: 29px; margin-left: 37px; margin-top: 22px"
src="../assets/images/navtop/logo.png"
/>
<div class="navTopRight">
<div class="role">
@@ -11,10 +11,10 @@
<div class="roleArrow"></div>
<div class="roleItems">
<div
v-for="(value, index) in roleList"
:key="index"
class="roleItem"
@click="changeRole(value)"
v-for="(value, index) in roleList"
:key="index"
class="roleItem"
@click="changeRole(value)"
>
{{ value.name }}
</div>
@@ -22,14 +22,14 @@
</div>
<div class="user">
<img
style="
style="
width: 40px;
height: 40px;
margin-left: 8px;
border-radius: 15px;
margin-right: 10px;
"
:src="avatar"
:src="avatar"
/>
<div style="margin-right: 20px">{{ username }}</div>
</div>
@@ -47,20 +47,21 @@
</div> -->
<div class="signOutMain" @click="logOut">
<img
style="width: 27px; height: 27px"
src="../assets/images/navtop/signout.png"
style="width: 27px; height: 27px"
src="../assets/images/navtop/signout.png"
/>
<span class="signOut">登出</span>
</div>
</div>
</div>
</div>
<down-load v-model:downloadVisible="visible" />
<down-load v-model:downloadVisible="visible"/>
</template>
<script>
import { reactive, toRefs } from "vue";
import {reactive, toRefs} from "vue";
import DownLoad from "../components/drawers/DownLoad";
import * as api from "../api/index1";
export default {
name: "NavTop",
components: {
@@ -100,24 +101,32 @@ export default {
};
const getUser = () => {
api
.getUser()
.then((res) => {
console.log("获取登录信息成功", res);
if (res.data.code === 200) {
state.username = res.data.data.realName;
// state.avatar = res.data.data.avatar
// ? res.data.data.avatar
// : require("../assets/images/avatar.png");
state.avatar = require("../assets/images/avatar.png");
}
})
.catch((err) => {
console.log("获取登录信息失败", err);
});
.getUser()
.then((res) => {
console.log("获取登录信息成功", res);
if (res.data.code === 200) {
state.username = res.data.data.realName;
// state.avatar = res.data.data.avatar
// ? res.data.data.avatar
// : require("../assets/images/avatar.png");
state.avatar = require("../assets/images/avatar.png");
}
})
.catch((err) => {
console.log("获取登录信息失败", err);
});
};
getUser();
const logOut = () => {
localStorage.removeItem('faceclassPic');
localStorage.removeItem('faceclassClass');
localStorage.removeItem('faceclassScene');
localStorage.removeItem('projectLevel');
localStorage.removeItem('projectSys');
localStorage.removeItem('pathmapPic');
localStorage.removeItem('projectClass');
localStorage.removeItem('projectPic');
window.open("https://u-pre.boe.com/web/", "_self");
};
return {
@@ -142,9 +151,11 @@ export default {
display: flex;
justify-content: space-between;
background-color: rgba(255, 255, 255, 1);
.navTopRight {
display: flex;
}
.role {
display: flex;
align-items: center;
@@ -154,6 +165,7 @@ export default {
line-height: 36px;
cursor: pointer;
position: relative;
.roleArrow {
width: 13px;
height: 7px;
@@ -161,6 +173,7 @@ export default {
background-image: url(../assets/images/navtop/down.png);
background-size: 100%;
}
.roleItems {
width: 109px;
height: 90px;
@@ -174,22 +187,27 @@ export default {
display: none;
z-index: 100;
}
.roleItem {
font-size: 14px;
font-weight: 400;
color: rgba(79, 81, 86, 1);
line-height: 36px;
}
.roleItem:hover {
color: #4ea6ff;
}
}
.role:hover .roleItems {
display: block;
}
.role:hover .roleArrow {
background-image: url(../assets/images/navtop/up.png);
}
.user {
margin-left: 37px;
display: flex;
@@ -199,12 +217,14 @@ export default {
color: #b3bdc4;
line-height: 36px;
}
.signOutMain {
cursor: pointer;
margin-right: 29px;
display: flex;
align-items: center;
}
.signOut {
font-size: 16px;
font-weight: 400;