【新增】完善后台首页面板
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="stat-card primary">
|
||||
<i class="bi bi-people-fill"></i>
|
||||
<h3>1,234</h3>
|
||||
<h3>{{statistics.userCount}}</h3>
|
||||
<p>用户数</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="stat-card warning">
|
||||
<i class="bi bi-graph-up"></i>
|
||||
<h3>89%</h3>
|
||||
<h3>{{statistics.firmwareCount}}</h3>
|
||||
<p>固件数</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,6 +66,10 @@
|
||||
username: '',
|
||||
realName: '',
|
||||
userId: ''
|
||||
},
|
||||
statistics: {
|
||||
userCount: 0,
|
||||
firmwareCount: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -90,10 +94,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
async loadStatistics() {
|
||||
try {
|
||||
const response = await request.get('/main/statistics');
|
||||
if (response.code === 200) {
|
||||
this.statistics = response.data;
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 加载用户信息
|
||||
this.loadUserInfo();
|
||||
// 加载统计信息
|
||||
this.loadStatistics();
|
||||
}
|
||||
}).mount('#app');
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user