=> ({
+ filterDropdown: ({
+ setSelectedKeys,
+ selectedKeys,
+ confirm,
+ clearFilters,
+ close,
+ }) => (
+ e.stopPropagation()}>
+
+ setSelectedKeys(e.target.value ? [e.target.value] : [])
+ }
+ onPressEnter={() =>
+ handleSearch(selectedKeys as string[], confirm, dataIndex)
+ }
+ style={{ marginBottom: 8, display: "block" }}
+ />
+
+
+
+
+
+
+
+ ),
+ filterIcon: (filtered: boolean) => (
+
+ ),
+ onFilter: (value, record: User) => {
+ let result = record?.[dataIndex];
+ if (result) {
+ return result
+ .toString()
+ .toLowerCase()
+ .includes((value as string).toLowerCase());
+ }
+ return false;
+ },
+ onFilterDropdownOpenChange: (visible) => {
+ if (visible) {
+ setTimeout(() => searchInput.current?.select(), 100);
+ }
+ },
+ render: (text) =>
+ searchedColumn === dataIndex ? (
+
+ ) : (
+ text
+ ),
+ });
+
+ const columns: TableColumnsType = [
+ { title: "Name", dataIndex: "name", ...getColumnSearchProps("name") },
+ {
+ title: "UserName",
+ dataIndex: "username",
+ ...getColumnSearchProps("username"),
+ },
+ { title: "Email", dataIndex: "email", ...getColumnSearchProps("email") },
+ {
+ title: "createdAt",
+ dataIndex: "createdAt",
+ render: (value) => getCurrentTime(value),
+ sorter: (a, b) => {
+ if (a.createdAt < b.createdAt) return 1;
+ return -1;
+ },
+ },
+ {
+ title: "updatedAt",
+ dataIndex: "updatedAt",
+ render: (value) => getCurrentTime(value),
+ },
+ ];
+
+ return ;
+}
+
+export default UsersTable;
diff --git a/app/utils/custom.ts b/app/utils/custom.ts
index a6636f7d3..43aba914c 100644
--- a/app/utils/custom.ts
+++ b/app/utils/custom.ts
@@ -1,5 +1,7 @@
-export function getCurrentTime(): string {
- const now = new Date();
+export function getCurrentTime(now?: Date): string {
+ if (!now) {
+ const now = new Date();
+ }
const formatter = new Intl.DateTimeFormat("zh-CN", {
timeZone: "Asia/Shanghai", // 设置为中国标准时间
year: "numeric",
diff --git a/lib/auth_list.ts b/lib/auth_list.ts
index c28ea6df2..5dfd2a68b 100644
--- a/lib/auth_list.ts
+++ b/lib/auth_list.ts
@@ -1,6 +1,6 @@
export const DENY_LIST: string[] = [
- "suibian", "某某", "张三", "李四", "啊实打实", "官方回复电话", "笑死", "观化听风"
+ "suibian", "某某", "张三", "李四", "啊实打实", "官方回复电话", "笑死", "观化听风", "null", "undefined",
]
export const ADMIN_LIST: string[] = [
"司金辉", "sijinhui", "sijinhui@qq.com",
diff --git a/package.json b/package.json
index cf35973cc..d555554c5 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"nodemailer": "^6.9.13",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "react-highlight-words": "^0.20.0",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.21.3",
"rehype-highlight": "^7.0.0",