guhongwei 1 éve
szülő
commit
349a1d8790
1 módosított fájl, 20 hozzáadás és 12 törlés
  1. 20 12
      src/components/admin-frame/parts/Header.vue

+ 20 - 12
src/components/admin-frame/parts/Header.vue

@@ -12,8 +12,11 @@
               <span>{{ siteInfo.zhTitle }}-管理中心</span>
             </el-col>
             <el-col :span="12" class="right">
-              <i class="el-icon-user-solid"></i>
-              <span>{{ user && user._id ? user.name || user.title || user.expert_name : '游客' }}</span>
+              <el-button type="primary" size="small" @click="toWeb">网站平台</el-button>
+              <span>
+                <el-icon><UserFilled /></el-icon>
+                {{ user && user._id ? user.name || user.title || user.expert_name : '游客' }}
+              </span>
               <el-button type="danger" size="small" @click="logout">退出登录</el-button>
             </el-col>
           </el-col>
@@ -32,6 +35,14 @@ import { useRouter } from 'vue-router'
 const router = useRouter()
 let collapse: Ref<any> = ref(false)
 let user: Ref<any> = ref(store.state.user)
+// 网站平台
+const toWeb = () => {
+  let env = import.meta.env.VITE_APP_ENV
+  let path = ''
+  if (env == 'development') path = 'http://localhost:8001/zkzxweb'
+  else path = '/zkzxweb'
+  window.open(path)
+}
 // 退出登录
 const logout = () => {
   sessionStorage.removeItem('token')
@@ -59,18 +70,15 @@ const logout = () => {
     }
     .right {
       text-align: right;
-      line-height: 50px;
-      i {
+      padding: 16px 0;
+      span {
+        padding: 0 8px;
+        color: #ffffff;
         position: relative;
-        top: 5px;
-        margin: 0px 15px;
-        font-size: 30px;
-        color: #fff;
+        top: 1px;
       }
-      span {
-        color: #fff;
-        font-size: 16px;
-        padding: 0 15px 0 0px;
+      .el-icon {
+        top: 2px;
       }
     }
   }