diff --git a/src/admin/api.ts b/src/admin/api.ts index af14c12..0eae758 100644 --- a/src/admin/api.ts +++ b/src/admin/api.ts @@ -287,16 +287,6 @@ export function createAnnouncement(announcement: AnnouncementEdit) { return http.post("admin/announcement", announcement) } -export function getCommentList(offset = 0, limit = 10, problem: string) { - return http.get("admin/comment", { - params: { offset, limit, problem }, - }) -} - -export function deleteComment(id: number) { - return http.delete("admin/comment", { params: { id } }) -} - export function getReactionStats( offset = 0, limit = 10, diff --git a/src/admin/communication/comments.vue b/src/admin/communication/comments.vue deleted file mode 100644 index c747d2d..0000000 --- a/src/admin/communication/comments.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - 评论列表(只列出有内容的) - - - - - - - - - diff --git a/src/admin/communication/components/CommentActions.vue b/src/admin/communication/components/CommentActions.vue deleted file mode 100644 index fc3e062..0000000 --- a/src/admin/communication/components/CommentActions.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 删除 - - 确定删除这条评论吗? - - diff --git a/src/oj/api.ts b/src/oj/api.ts index 531dbfb..8cd12a0 100644 --- a/src/oj/api.ts +++ b/src/oj/api.ts @@ -224,24 +224,6 @@ export function getMessageList(offset = 0, limit = 10) { return http.get("message", { params: { limit, offset } }) } -export function createComment(data: { - problem_id: number - description_rating: number - difficulty_rating: number - comprehensive_rating: number - content: string -}) { - return http.post("comment", data) -} - -export function getComment(problemID: number) { - return http.get("comment", { params: { problem_id: problemID } }) -} - -export function getCommentStatistics(problemID: number) { - return http.get("comment/statistics", { params: { problem_id: problemID } }) -} - export function getReaction(problemID: number) { return http.get("reaction", { params: { problem_id: problemID } }) } diff --git a/src/oj/problem/components/ProblemComment.vue b/src/oj/problem/components/ProblemComment.vue deleted file mode 100644 index f2eb383..0000000 --- a/src/oj/problem/components/ProblemComment.vue +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - {{ content }} - - - 查看统计 - - - 提交 - - - - - - {{ count }} - - - {{ rating.description }} - - - {{ rating.difficulty }} - - - {{ rating.comprehensive }} - - - - 暂无记录,快去评论吧 - - - - - - - diff --git a/src/oj/problem/components/SubmitCode.vue b/src/oj/problem/components/SubmitCode.vue index 4833b7f..e2beeb3 100644 --- a/src/oj/problem/components/SubmitCode.vue +++ b/src/oj/problem/components/SubmitCode.vue @@ -3,7 +3,7 @@ import { Icon } from "@iconify/vue" import { storeToRefs } from "pinia" import { formatCode, - getComment, + getReaction, submitCode, updateProblemSetProgress, } from "oj/api" @@ -72,8 +72,8 @@ const { start: startCooldown, isPending: isCooldown } = useTimeout(5000, { // ==================== AC后显示评论框 ==================== const { start: showCommentPanelDelayed } = useTimeoutFn( async () => { - const res = await getComment(problem.value!.id) - if (!res.data) { + const res = await getReaction(problem.value!.id) + if (res.data.mine.length === 0) { commentPanel.value = true } }, diff --git a/src/shared/layout/admin.vue b/src/shared/layout/admin.vue index 998988c..6521858 100644 --- a/src/shared/layout/admin.vue +++ b/src/shared/layout/admin.vue @@ -177,7 +177,6 @@ const active = computed(() => { if (path.startsWith("/admin/problem")) return "admin problem list" if (path.startsWith("/admin/contest")) return "admin contest list" if (path.startsWith("/admin/user")) return "admin user list" - if (path.startsWith("/admin/comment")) return "admin comment list" if (path.startsWith("/admin/announcement")) return "admin announcement list" if (path.startsWith("/admin/tutorial")) return "admin tutorial list" if (path.startsWith("/admin/ai")) return "admin ai reports" diff --git a/src/utils/permissions.ts b/src/utils/permissions.ts index 3b8b137..861529d 100644 --- a/src/utils/permissions.ts +++ b/src/utils/permissions.ts @@ -12,7 +12,6 @@ export function usePermissions() { canManageUsers: computed(() => userStore.isSuperAdmin), canManageAnnouncements: computed(() => userStore.isSuperAdmin), - canManageComments: computed(() => userStore.isSuperAdmin), canManageTutorials: computed(() => userStore.isSuperAdmin), canManageSystemConfig: computed(() => userStore.isSuperAdmin), canSendMessages: computed(() => userStore.isSuperAdmin), @@ -65,7 +64,6 @@ export function checkRoutePermission(routeName: string): boolean { "admin announcement list", "admin announcement create", "admin announcement edit", - "admin comment list", "admin message list", "admin tutorial list", "admin tutorial create", diff --git a/src/utils/types.ts b/src/utils/types.ts index efafcff..91c2f95 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -594,18 +594,6 @@ export interface CreateMessage { message: string } -export interface Comment { - id: number - problem: string - submission: string - content: string - description_rating: 1 | 2 | 3 | 4 | 5 - difficulty_rating: 1 | 2 | 3 | 4 | 5 - comprehensive_rating: 1 | 2 | 3 | 4 | 5 - create_time: Date - user: SampleUser -} - export type ReactionKey = | "too_easy" | "too_hard"