|
@@ -54,146 +54,151 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
-import { SessionStorageService, LocalStorageService } from '@/utils/storage';
|
|
|
-import { ref, onMounted, computed, watch } from 'vue';
|
|
|
-import userImg from '@/assets/images/backgroundicon.png';
|
|
|
-import logo_public from '@/assets/images/logo_public.png';
|
|
|
-import avatar from '@/assets/images/avatar.png'
|
|
|
-import orderImg from '@/assets/images/order.svg';
|
|
|
-import { removeToken } from '@/utils/cookie';
|
|
|
-import store from '@/store';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
+ import { SessionStorageService, LocalStorageService } from '@/utils/storage';
|
|
|
+ import { ref, onMounted, computed, watch } from 'vue';
|
|
|
+ import userImg from '@/assets/images/backgroundicon.png';
|
|
|
+ import logo_public from '@/assets/images/logo_public.png';
|
|
|
+ import avatar from '@/assets/images/avatar.png';
|
|
|
+ import orderImg from '@/assets/images/order.svg';
|
|
|
+ import { removeToken } from '@/utils/cookie';
|
|
|
+ import store from '@/store';
|
|
|
|
|
|
-const router = useRouter();
|
|
|
-console.log('mounted');
|
|
|
+ const router = useRouter();
|
|
|
+ console.log('mounted');
|
|
|
|
|
|
-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;
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-function goToPage(path) {
|
|
|
- router.replace({
|
|
|
- path: path,
|
|
|
- });
|
|
|
-}
|
|
|
-goToPage('/bookList');
|
|
|
-const quite = () => {
|
|
|
- removeToken();
|
|
|
- LocalStorageService.clearAll();
|
|
|
- window.location.href = 'http://www.sqjyy.cn/cas/logout?service=http://www.sqjyy.cn';
|
|
|
- //store.dispatch('user/LogOut');
|
|
|
- //window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
-};
|
|
|
-const toAccount = () => {
|
|
|
- window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
-};
|
|
|
-console.log(store.state.user.userInfo, 'store.state.user.userInfo');
|
|
|
-const userinfo = ref(LocalStorageService.get('userInfo'));
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
-watch(
|
|
|
- () => store.state.user.userInfo,
|
|
|
- (val, old) => {
|
|
|
- userinfo.value = val;
|
|
|
+ function goToPage(path) {
|
|
|
+ router.replace({
|
|
|
+ path: path,
|
|
|
+ });
|
|
|
}
|
|
|
-);
|
|
|
+ goToPage('/bookList');
|
|
|
+ const quite = () => {
|
|
|
+ removeToken();
|
|
|
+ LocalStorageService.clearAll();
|
|
|
+ window.location.href = 'http://www.sqjyy.cn/cas/logout?service=http://www.sqjyy.cn';
|
|
|
+ //store.dispatch('user/LogOut');
|
|
|
+ //window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
+ };
|
|
|
+ const toAccount = () => {
|
|
|
+ window.location.href = import.meta.env.VITE_APP_BOOK_STORE_URL as string;
|
|
|
+ };
|
|
|
+ console.log(store.state.user.userInfo, 'store.state.user.userInfo');
|
|
|
+ const userinfo = ref(LocalStorageService.get('userInfo'));
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => store.state.user.userInfo,
|
|
|
+ (val, old) => {
|
|
|
+ userinfo.value = val;
|
|
|
+ }
|
|
|
+ );
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.main {
|
|
|
- width: 100%;
|
|
|
- position: fixed;
|
|
|
- background: white;
|
|
|
- z-index: 2;
|
|
|
- top: 0;
|
|
|
- .user-info {
|
|
|
- width: 1160px;
|
|
|
- min-width: 1160px;
|
|
|
- max-width: 1160px;
|
|
|
- margin: 0 auto;
|
|
|
- display: flex;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- height: 80px;
|
|
|
- .logo,
|
|
|
- img {
|
|
|
- width: auto;
|
|
|
- height: 48px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- .info {
|
|
|
+ .main {
|
|
|
+ width: 100%;
|
|
|
+ position: fixed;
|
|
|
+ background: white;
|
|
|
+ z-index: 2;
|
|
|
+ top: 0;
|
|
|
+ .user-info {
|
|
|
+ width: 1160px;
|
|
|
+ min-width: 1160px;
|
|
|
+ max-width: 1160px;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: flex;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ height: 80px;
|
|
|
+ .logo,
|
|
|
img {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- /*margin: 0 10px;*/
|
|
|
- margin-right: 4px;
|
|
|
+ width: auto;
|
|
|
+ height: 48px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ /*margin: 0 10px;*/
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+ .ant-dropdown-link {
|
|
|
+ color: #333333;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
}
|
|
|
- .ant-dropdown-link {
|
|
|
+ }
|
|
|
+ .logo {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ span {
|
|
|
+ font-size: 24px;
|
|
|
+ font-family: PingFangSC-Medium, PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
color: #333333;
|
|
|
- font-size: 14px;
|
|
|
+ }
|
|
|
+ // .imgicon {
|
|
|
+ // height: 28px;
|
|
|
+ // width: 285px;
|
|
|
+ // }
|
|
|
+ a {
|
|
|
+ margin-left: 64px;
|
|
|
+ color: @primary-color;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .logo {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- span {
|
|
|
- font-size: 24px;
|
|
|
- font-family: PingFangSC-Medium, PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
+
|
|
|
+ .user_info_title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
color: #333333;
|
|
|
}
|
|
|
- // .imgicon {
|
|
|
- // height: 28px;
|
|
|
- // width: 285px;
|
|
|
- // }
|
|
|
- a {
|
|
|
- margin-left: 64px;
|
|
|
- color: @primary-color;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .user_info_title {
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFangSC-Regular, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #333333;
|
|
|
- }
|
|
|
-}
|
|
|
-@media screen and (max-width: 1024px) {
|
|
|
- .main {
|
|
|
- width: 100% !important;
|
|
|
}
|
|
|
- .user-info {
|
|
|
- padding: 0 20px;
|
|
|
- width: 100% !important;
|
|
|
- min-width: 100% !important;
|
|
|
- max-width: 100% !important;
|
|
|
+ @media screen and (max-width: 1024px) {
|
|
|
+ .main {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+ .user-info {
|
|
|
+ padding: 0 20px;
|
|
|
+ width: 100% !important;
|
|
|
+ min-width: 100% !important;
|
|
|
+ max-width: 100% !important;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
-@media screen and (max-width: 600px) {
|
|
|
- .user-info {
|
|
|
- .imgicon {
|
|
|
- height: 10px !important;
|
|
|
- width: 100px !important;
|
|
|
+ @media screen and (max-width: 600px) {
|
|
|
+ .user-info {
|
|
|
+ .imgicon {
|
|
|
+ height: 10px !important;
|
|
|
+ width: 100px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .logo {
|
|
|
+ span {
|
|
|
+ font-size: 16px !important;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-/*@media screen and (max-width: 600px) {*/
|
|
|
-/* .main{*/
|
|
|
-/* width: 100% !important;*/
|
|
|
-/* }*/
|
|
|
-/* .user-info{*/
|
|
|
-/* width: 100% !important;*/
|
|
|
-/* min-width: 100% !important;*/
|
|
|
-/* max-width: 100% !important;*/
|
|
|
-/* }*/
|
|
|
-/*}*/
|
|
|
+ /*@media screen and (max-width: 600px) {*/
|
|
|
+ /* .main{*/
|
|
|
+ /* width: 100% !important;*/
|
|
|
+ /* }*/
|
|
|
+ /* .user-info{*/
|
|
|
+ /* width: 100% !important;*/
|
|
|
+ /* min-width: 100% !important;*/
|
|
|
+ /* max-width: 100% !important;*/
|
|
|
+ /* }*/
|
|
|
+ /*}*/
|
|
|
</style>
|