zhaobao преди 3 години
родител
ревизия
a12f207843
променени са 3 файла, в които са добавени 21 реда и са изтрити 7 реда
  1. 18 5
      src/layout/components/Navbar.vue
  2. 2 2
      src/settings.js
  3. 1 0
      src/store/modules/user.js

+ 18 - 5
src/layout/components/Navbar.vue

@@ -1,9 +1,17 @@
 <template>
   <div class="navbar">
     <div class="hos-name">
+      <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
       <img :src="logo" alt="logo">
       <span v-if="userData.ocName" class="tag">{{ userData.ocName }}</span>
-      <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
+      <countdown :end-time="userData.licExpiredTime">
+        <div
+          slot="process"
+          slot-scope="{ timeObj }"
+          class="tag authorization"
+        >({{ `${timeObj.d}天${timeObj.h}:${timeObj.m}:${timeObj.s}` }})</div>
+        <div slot="finish" class="tag error">请续费使用</div>
+      </countdown>
     </div>
     <!-- 隐藏标签 -->
     <breadcrumb v-if="0" id="breadcrumb-container" class="breadcrumb-container" />
@@ -209,19 +217,23 @@ export default {
   img{
       display: block;
       width: auto;
-      height: 36px;
+      height: 32px;
   }
   .tag{
     font-size: 16px;
-    line-height: 16px;
+    line-height: 1;
     font-weight: 600;
-    padding-left: 10px;
+    padding-left: 5px;
     margin-top: 15px;
+    &.authorization{
+      font-size: 14px;
+      color: rgba(255, 255, 255, 0.7);
+    }
   }
 }
   .hamburger-container {
     padding: 3px 6px;
-    margin-left: 10px;
+    margin-left: 5px;
     line-height: var(--navHeight);
     height: 100%;
     font-size: 16px;
@@ -316,6 +328,7 @@ export default {
         height: 40px;
         line-height: 40px;
         border-radius: 20px;
+        margin-right: 5px;
         .item-cont{
           display: block;
           height: 100%;

+ 2 - 2
src/settings.js

@@ -38,8 +38,8 @@ module.exports = {
   */
   serverUrl: 'http://1.15.92.205:8080/', // 正式环境
   // serverUrl: 'http://114.116.19.14:8080/', // 正式环境
-  devServerUrl: 'http://1.15.92.205:8001/', // 开发环境
-  // devServerUrl: 'http://192.168.3.253:8001/', // 开发环境
+  // devServerUrl: 'http://1.15.92.205:8001/', // 开发环境
+  devServerUrl: 'http://192.168.3.253:8001/', // 开发环境
   /**
   * websocket 地址
   * dev 开发环境

+ 1 - 0
src/store/modules/user.js

@@ -57,6 +57,7 @@ const actions = {
       f.append('password', password)
       login(f).then(response => {
         const { data } = response
+        data.user.licExpiredTime = data.licExpiredTime
         commit('SET_TOKEN', data.accessToken)
         commit('SET_NAME', data.user.userName)
         commit('SET_AVATAR', data.user.userAvatar)