| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <div class="header-wp">
- <div class="header-left-wp">
- <div class="title">两江资本</div>
- <div class="sub-title">无敌中控</div>
- </div>
- <div class="header-right-wp">
- <div class="info-wp">
- <div class="info-name">欢迎, {{ nickname }}</div>
- <lay-dropdown trigger="hover" placement="bottom-end" updateAtScroll>
- <div class="info-avatar">
- <img :src="avatarUrl" />
- </div>
- <template #content>
- <lay-dropdown-menu>
- <lay-dropdown-menu-item @click="handeLoginOut()">退出登录</lay-dropdown-menu-item>
- </lay-dropdown-menu>
- </template>
- </lay-dropdown>
- </div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { useRouter } from "vue-router";
- import { client_logout } from "@/api/index";
- const router = useRouter();
- defineProps({
- nickname: String,
- avatarUrl: String,
- });
- const handeLoginOut = () => {
- client_logout({}, () => {
- window.sessionStorage.removeItem("_4L_TOKEN");
- window.sessionStorage.removeItem("_4L_MENU_PATH");
- window.sessionStorage.removeItem("_4L_S_MENU_PATH");
- window.sessionStorage.removeItem("_4L_TAG_LIST");
- window.sessionStorage.removeItem("_4L_API_LIST");
- window.sessionStorage.removeItem("_4L_MENU_COLLAPSE");
- router.push({ path: "/login" });
- });
- };
- </script>
- <style lang="scss" scoped>
- .header-wp {
- box-sizing: border-box;
- height: 100%;
- width: 100%;
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- display: flex;
- .header-left-wp {
- box-sizing: border-box;
- display: flex;
- justify-content: center;
- flex-direction: column;
- text-align: center;
- width: 256px;
- border-right: 1px solid rgba(0, 0, 0, 0.1);
- .title {
- font-size: 18px;
- font-weight: bold;
- }
- .sub-title {
- font-weight: bold;
- }
- }
- .header-right-wp {
- flex: 1;
- display: flex;
- justify-content: right;
- align-items: center;
- .info-wp {
- display: flex;
- align-items: center;
- padding: 0 20px;
- .info-name {
- padding-right: 10px;
- font-size: 14px;
- }
- .info-avatar {
- font-size: 0;
- img {
- border-radius: 50%;
- width: 32px;
- height: 32px;
- }
- }
- }
- }
- }
- </style>
|