ananzhusen hai 1 ano
pai
achega
b342ce5ee5
Modificáronse 3 ficheiros con 16 adicións e 1 borrados
  1. 5 0
      src/services/user.ts
  2. 4 0
      src/views/components/Graphics.vue
  3. 7 1
      src/views/components/Header.vue

+ 5 - 0
src/services/user.ts

@@ -35,6 +35,7 @@ export interface IUser {
   github?: any;
   created?: any;
   createdAt?: any;
+  limit?: number;
 }
 
 const user = reactive<IUser>({
@@ -80,9 +81,13 @@ export const useUser = () => {
       }
     }
     const ret: IUser = await axios.get('/api/account/profile', { params });
+    const statistics: any = await axios.post('/api/account/statistics');
     if (!ret) {
       return;
     }
+    if (statistics) {
+      ret.limit = statistics.documents.le5leV.limit;
+    }
     setUser(ret);
 
     return user;

+ 4 - 0
src/views/components/Graphics.vue

@@ -1604,6 +1604,10 @@ onUnmounted(() => {
     .t-radio-button {
       width: 120px;
       height: 100%;
+      color: #fff;
+      &:hover {
+        color: var(--color-primary);
+      }
       &.t-is-checked {
         background-color: var(--color-primary) !important;
         color: #fff !important;

+ 7 - 1
src/views/components/Header.vue

@@ -258,7 +258,13 @@
         <t-dropdown-item divider="true">
           <a :href="assets.account">
             {{ user.username }}
-            <label class="ml-16 vip-label">VIP</label>
+            <label
+              class="ml-16 vip-label"
+              :style="{
+                color: user.limit > 1 ? '#ff4000' : '#4f5b75',
+              }"
+              >VIP</label
+            >
           </a>
         </t-dropdown-item>
         <t-dropdown-item divider="true">