Browse Source

优化简约版用户信息

林旭祥 1 week ago
parent
commit
21aebb2fee
2 changed files with 3 additions and 22 deletions
  1. 1 1
      src/components/Header/index.vue
  2. 2 21
      src/views/gesture/index.vue

+ 1 - 1
src/components/Header/index.vue

@@ -136,7 +136,7 @@ const getMusic = async () => {
 
 //获取个人信息
 const getUserInfo = () => {
-  if (props.type == 'home') {
+  if (['home', 'gesture'].includes(props.type)) {
     let params = {};
     proxy?.$http.common.getUserInfo(params).then((res: any) => {
       //保存信息

+ 2 - 21
src/views/gesture/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="gesture">
-    <Header :showTool="true" @confirmExit="getLogout" :key="key"></Header>
+    <Header :showTool="true" @confirmExit="getLogout" type="gesture"></Header>
     <div class="menu" v-if="projectList.length" :key="projectList.length">
       <swiper :slides-per-view="5" :space-between="0" :loop="true" :observe-parents="true" :observer="true"
         :centered-slides="true" :modules="[Navigation]" @swiper="onSwiper">
@@ -43,9 +43,8 @@ const data = reactive<any>({
   deviceInfo: {},
   erweima: '',
   sid: '',
-  key: 0
 });
-const { mySwiper, projectList, timerManager, deviceInfo, erweima, sid, key } = toRefs(data);
+const { mySwiper, projectList, timerManager, deviceInfo, erweima, sid } = toRefs(data);
 
 /**
  * 清空定时任务
@@ -237,23 +236,6 @@ const getTips = () => {
   }, myTime);
 };
 
-/**
- * 获取个人信息
- */
-const getUserInfo = () => {
-  let params = {};
-  proxy?.$http.common.getUserInfo(params).then((res: any) => {
-    //保存信息
-    if (res.data.length) {
-      let myData = res.data[0];
-      let info: any = JSON.stringify(myData);
-      localStorage.setItem('userInfo', info);
-      //修改收藏夹图标
-      proxy?.$utils.setFavicon(myData?.logo_url);
-      key.value = key.value + 1; //更新头部LOGO
-    }
-  });
-};
 
 /**
  * 获取设备项目
@@ -332,7 +314,6 @@ onBeforeMount(() => {
   });
 });
 onMounted(() => {
-  getUserInfo();
   //登录码
   getErweima();
   //提示语