|
@@ -42,9 +42,9 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
- <el-card shadow="hover" class="mt-5">
|
|
|
|
|
|
|
+ <el-card shadow="hover" class="mt-5" v-if="role === 'api'">
|
|
|
<div class="flex">
|
|
<div class="flex">
|
|
|
- <el-tabs class="demo-tabs mt-5" v-model="activeName" tab-position="left">
|
|
|
|
|
|
|
+ <el-tabs class="demo-tabs" v-model="activeName" tab-position="left">
|
|
|
<el-tab-pane name="user">
|
|
<el-tab-pane name="user">
|
|
|
<template #label>
|
|
<template #label>
|
|
|
<div class="flex items-center py-4">
|
|
<div class="flex items-center py-4">
|
|
@@ -228,12 +228,18 @@ function initChart() {
|
|
|
const userDatas = ref({
|
|
const userDatas = ref({
|
|
|
today: 0
|
|
today: 0
|
|
|
})
|
|
})
|
|
|
|
|
+const role = ref('admin')
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- http.get('/admin/users/getDatas', {
|
|
|
|
|
- apiUserId: user.apiUserId
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- userDatas.value = res
|
|
|
|
|
- initChart()
|
|
|
|
|
|
|
+ http.get(`/auth/admin/getRole`).then((res) => {
|
|
|
|
|
+ if (res === 'api') {
|
|
|
|
|
+ role.value = 'api'
|
|
|
|
|
+ http.get('/admin/users/getDatas', {
|
|
|
|
|
+ apiUserId: user.apiUserId
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ userDatas.value = res
|
|
|
|
|
+ initChart()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|