博客评论添加ip及地址

This commit is contained in:
2025-06-08 22:00:02 +08:00
parent bff23ebf90
commit 3bdf97ec7b
3 changed files with 7 additions and 6 deletions

View File

@@ -9,11 +9,11 @@ export class BlogComment {
@Column() @Column()
content: string; content: string;
// @Column() @Column()
// ip: string; ip: string;
// @Column() @Column()
// address: string; address: string;
@CreateDateColumn({ precision: 3 }) @CreateDateColumn({ precision: 3 })
createdAt: Date; createdAt: Date;

View File

@@ -41,7 +41,7 @@ export function BlogComments({ blogId }: { blogId: string }) {
<div className="whitespace-pre-wrap break-all">{d.content}</div> <div className="whitespace-pre-wrap break-all">{d.content}</div>
<div className="text-xs text-zinc-500 flex gap-2"> <div className="text-xs text-zinc-500 flex gap-2">
<p>{new Date(d.createdAt).toLocaleString()}</p> <p>{new Date(d.createdAt).toLocaleString()}</p>
<p></p> <p>{d.address}</p>
<p className="text-zinc-900 cursor-pointer" onClick={() => setReplayTarget(d)}></p> <p className="text-zinc-900 cursor-pointer" onClick={() => setReplayTarget(d)}></p>
</div> </div>
{ {
@@ -54,7 +54,7 @@ export function BlogComments({ blogId }: { blogId: string }) {
<div className="whitespace-pre-wrap break-all">{c.content}</div> <div className="whitespace-pre-wrap break-all">{c.content}</div>
<div className="text-xs text-zinc-500 flex gap-2"> <div className="text-xs text-zinc-500 flex gap-2">
<p>{new Date().toLocaleString()}</p> <p>{new Date().toLocaleString()}</p>
<p></p> <p>{c.address}</p>
</div> </div>
</div> </div>
)) ))

View File

@@ -8,4 +8,5 @@ export interface BlogComment {
deletedAt: string | null; deletedAt: string | null;
parentId: string | null; parentId: string | null;
user: User | null; user: User | null;
address: string;
} }