|
@@ -7,7 +7,7 @@
|
|
|
-->
|
|
|
<template>
|
|
|
<div class="header">
|
|
|
- <div class="title"><img :src="getPng()?logo:logo_public" alt="" /></div>
|
|
|
+ <div class="title"> <img :src="login" @click="goMH" /></div>
|
|
|
<!-- <div class="userinfo">
|
|
|
<a-avatar style="background-color: #87d068" size="small">
|
|
|
<template #icon>
|
|
@@ -20,75 +20,84 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { UserOutlined } from '@ant-design/icons-vue';
|
|
|
-import { SessionStorageService, LocalStorageService } from '@/utils/storage';
|
|
|
-import { ref, onMounted, computed, watch } from 'vue';
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
-import { removeToken } from '@/utils/cookie';
|
|
|
-import logo from '@/assets/tital.png'
|
|
|
-import logo_public from '@/assets/logo_public.png'
|
|
|
-import store from '@/store';
|
|
|
-const colorList = '#f56a00';
|
|
|
-let avatarValue = '超级';
|
|
|
-console.log('mounted');
|
|
|
+ import { UserOutlined } from '@ant-design/icons-vue';
|
|
|
+ import { SessionStorageService, LocalStorageService } from '@/utils/storage';
|
|
|
+ import { ref, onMounted, computed, watch } from 'vue';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
+ import { removeToken } from '@/utils/cookie';
|
|
|
+ import logo from '@/assets/tital.png';
|
|
|
+ import logo_public from '@/assets/logo_public.png';
|
|
|
+ import publicFn from '@/api/publicApi';
|
|
|
+ import store from '@/store';
|
|
|
+ const colorList = '#f56a00';
|
|
|
+ let avatarValue = '超级';
|
|
|
+ console.log('mounted');
|
|
|
+ const userinfo = ref(LocalStorageService.get('userInfo'));
|
|
|
+ const router = useRouter();
|
|
|
+ const login = import.meta.env.VITE_LOGO ? import.meta.env.VITE_LOGO : logo;
|
|
|
+ const isLog = import.meta.env.VITE_APP_PATH;
|
|
|
+ const logPng = ref();
|
|
|
|
|
|
-const router = useRouter();
|
|
|
-
|
|
|
-const isLog = import.meta.env.VITE_APP_PATH
|
|
|
-const getPng = () => {
|
|
|
- console.log(1)
|
|
|
- if(isLog == 'production'||isLog =='development'){
|
|
|
- return true
|
|
|
- }else{
|
|
|
- console.log(2)
|
|
|
- return false
|
|
|
+ const getLogin = () => {
|
|
|
+ if (!userinfo.value) return;
|
|
|
+ publicFn.getTenant(store.getters.userInfo?.tenantId).then((res) => {
|
|
|
+ const { code, data } = res.data;
|
|
|
+ if (code == 200) {
|
|
|
+ console.log(res.data);
|
|
|
+ if (data.logo.split(',')[0]) {
|
|
|
+ logPng.value = import.meta.env.VITE_APP_IMG + data.logo.split(',')[0];
|
|
|
+ } else {
|
|
|
+ logPng.value = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+ // getLogin();
|
|
|
+ const quit = () => {
|
|
|
+ removeToken();
|
|
|
+ LocalStorageService.clearAll();
|
|
|
+ store.dispatch('user/LogOut');
|
|
|
+ window.location.href = 'http://www.sqjyy.cn/cas/logout?service=http://www.sqjyy.cn';
|
|
|
+ // window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
+ // router.push('/entry/login');
|
|
|
+ };
|
|
|
+ const goMH = () => {
|
|
|
+ console.log(import.meta.env.VITE_MH_ADDRESS);
|
|
|
+ window.open(import.meta.env.VITE_MH_ADDRESS as string | undefined);
|
|
|
+ };
|
|
|
+ watch(
|
|
|
+ () => store.state.user.userInfo,
|
|
|
+ (val, old) => {
|
|
|
+ userinfo.value = val;
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-const quit = () => {
|
|
|
- removeToken();
|
|
|
- LocalStorageService.clearAll();
|
|
|
- store.dispatch('user/LogOut');
|
|
|
- window.location.href = 'http://www.sqjyy.cn/cas/logout?service=http://www.sqjyy.cn';
|
|
|
- // window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
- // router.push('/entry/login');
|
|
|
-};
|
|
|
-
|
|
|
-const userinfo = ref(LocalStorageService.get('userInfo'));
|
|
|
-
|
|
|
-watch(
|
|
|
- () => store.state.user.userInfo,
|
|
|
- (val, old) => {
|
|
|
- userinfo.value = val;
|
|
|
- }
|
|
|
-);
|
|
|
+ );
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.header {
|
|
|
- height: 6.4rem;
|
|
|
- line-height: 6.4rem;
|
|
|
- background: #ffffff;
|
|
|
- z-index: 100;
|
|
|
- box-shadow: 0px 12px 20px 0px rgba(97, 131, 155, 0.06);
|
|
|
- color: #000;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 0 4rem;
|
|
|
- position: fixed;
|
|
|
- width: 100%;
|
|
|
- .title {
|
|
|
- font-size: 2rem;
|
|
|
- font-weight: bold;
|
|
|
- img {
|
|
|
- width: 285px;
|
|
|
- height: 28px;
|
|
|
+ .header {
|
|
|
+ height: 6.4rem;
|
|
|
+ line-height: 6.4rem;
|
|
|
+ background: #ffffff;
|
|
|
+ z-index: 100;
|
|
|
+ box-shadow: 0px 12px 20px 0px rgba(97, 131, 155, 0.06);
|
|
|
+ color: #000;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 4rem;
|
|
|
+ position: fixed;
|
|
|
+ width: 100%;
|
|
|
+ .title {
|
|
|
+ font-size: 2rem;
|
|
|
+ font-weight: bold;
|
|
|
+ img {
|
|
|
+ width: 285px;
|
|
|
+ height: 28px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .quit {
|
|
|
+ color: @link-color;
|
|
|
+ margin-left: 5px;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
- .quit {
|
|
|
- color: @link-color;
|
|
|
- margin-left: 5px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|