|
@@ -2,7 +2,7 @@
|
|
|
<div class="main">
|
|
|
<div class="user-info">
|
|
|
<div class="logo">
|
|
|
- <img :src="getPng() ? userImg : logo_public" class="imgicon" />
|
|
|
+ <img :src="logPng ? logPng : login" @click="goMH" />
|
|
|
<!-- {{
|
|
|
userinfo?.userinfo?.orgList[0]?.name ? userinfo.userinfo.orgList[0].name : '宿迁市教育局'
|
|
|
}} -->
|
|
@@ -63,11 +63,11 @@
|
|
|
import orderImg from '@/assets/images/order.svg';
|
|
|
import { removeToken } from '@/utils/cookie';
|
|
|
import { useStore } from 'vuex';
|
|
|
-
|
|
|
+ import publicFn from '@/api/publicApi';
|
|
|
const store = useStore();
|
|
|
const router = useRouter();
|
|
|
console.log('mounted');
|
|
|
-
|
|
|
+ const userinfo = ref(store.getters.userInfo.subject);
|
|
|
const isLog = import.meta.env.VITE_APP_PATH;
|
|
|
const getPng = () => {
|
|
|
console.log(1);
|
|
@@ -78,7 +78,25 @@
|
|
|
return false;
|
|
|
}
|
|
|
};
|
|
|
+ const login = import.meta.env.VITE_LOGO ? import.meta.env.VITE_LOGO : userImg;
|
|
|
+ const logPng = ref();
|
|
|
|
|
|
+ const getLogin = () => {
|
|
|
+ console.log(userinfo.value, 'infoDatainfoDatainfoData');
|
|
|
+ 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();
|
|
|
// function goToPage(path) {
|
|
|
// router.replace({
|
|
|
// path: path,
|
|
@@ -96,11 +114,15 @@
|
|
|
//store.dispatch('user/LogOut');
|
|
|
//window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
};
|
|
|
+ const goMH = () => {
|
|
|
+ console.log(import.meta.env.VITE_MH_ADDRESS);
|
|
|
+ window.open(import.meta.env.VITE_MH_ADDRESS as string | undefined);
|
|
|
+ };
|
|
|
const toAccount = () => {
|
|
|
window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
};
|
|
|
console.log(store.getters.userInfo, 'store.state.user.userInfo');
|
|
|
- const userinfo = ref(store.getters.userInfo.subject);
|
|
|
+
|
|
|
console.log(userinfo.value, '+++++', store.state.user.userInfo);
|
|
|
|
|
|
watch(
|