diff --git a/apps/api/src/app.service.ts b/apps/api/src/app.service.ts
index 2ae6ca1..8d0faf6 100644
--- a/apps/api/src/app.service.ts
+++ b/apps/api/src/app.service.ts
@@ -26,14 +26,14 @@ export class AppService {
.orderBy('user_level', 'DESC')
.getRawMany();
- for (const item of data) {
- const { user_id } = item;
- const msg_contents = await this.danmuRepository.find({
- select: ['msg_content'],
- where: { user_id },
- });
- item.msg_contents = msg_contents;
- }
+ // for (const item of data) {
+ // const { user_id } = item;
+ // const msg_contents = await this.danmuRepository.find({
+ // select: ['msg_content'],
+ // where: { user_id },
+ // });
+ // item.msg_contents = msg_contents;
+ // }
return data;
}
@@ -42,6 +42,6 @@ export class AppService {
select: ['msg_content'],
where: { user_id },
});
- return data;
+ return data.map((i) => i.msg_content);
}
}
diff --git a/apps/viewer/src/Dashboard.tsx b/apps/viewer/src/Dashboard.tsx
index a0d2e83..2eca401 100644
--- a/apps/viewer/src/Dashboard.tsx
+++ b/apps/viewer/src/Dashboard.tsx
@@ -1,9 +1,11 @@
import { useState, useEffect } from "react";
-import { Table, Button, Space } from "antd";
+import { Table, Button, Space, Tag } from "antd";
import axios from "axios";
export const Dashboard = () => {
const [dataSource, setDatasource] = useState<[]>([]);
+ const [expandedRowData, setExpandedRowData] = useState({});
+ const [loading, setLoading] = useState(false);
useEffect(() => {
const fetchData = async () => {
@@ -24,18 +26,19 @@ export const Dashboard = () => {
const columns = [
{
- title: "昵称",
- dataIndex: "nickName",
- key: "nickName",
+ title: "#",
+ key: "index",
+ render: (text, record, index) => index + 1, // 添加序号列
},
{
- title: "身份",
- key: "base",
- render: (record) => {
+ title: "昵称",
+ key: "nickName",
+ render: (record: any) => {
return (
正在加载数据...
; + if (data) + return ( + <> + {data.map((i, index) => ( +