update
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-09-25 20:12:24 +08:00
parent 59a81c7601
commit f7b8ef8978
6 changed files with 66 additions and 102 deletions

View File

@@ -119,49 +119,54 @@ async function getProblemDetail() {
toggleReady(true)
return
}
const { data } = await getProblem(props.problemID)
toggleReady(true)
problem.value.id = data.id
problem.value._id = data._id
problem.value.title = data.title
problem.value.description = data.description
problem.value.input_description = data.input_description
problem.value.output_description = data.output_description
problem.value.time_limit = data.time_limit
problem.value.memory_limit = data.memory_limit
problem.value.memory_limit = data.memory_limit
problem.value.difficulty = data.difficulty
problem.value.visible = data.visible
problem.value.share_submission = data.share_submission
problem.value.tags = data.tags
problem.value.languages = data.languages
problem.value.template = data.template
problem.value.samples = data.samples
problem.value.samples = data.samples
problem.value.spj = data.spj
problem.value.spj_language = data.spj_language
problem.value.spj_code = data.spj_code
problem.value.spj_compile_ok = data.spj_compile_ok
problem.value.test_case_id = data.test_case_id
problem.value.test_case_score = data.test_case_score
problem.value.rule_type = data.rule_type
problem.value.hint = data.hint
problem.value.source = data.source
problem.value.io_mode = data.io_mode
if (problem.value.contest_id) {
problem.value.contest_id = problem.value.contest_id
}
// 下面是用来显示的:
// 代码模板 和 模板开关
problem.value.languages.forEach((lang) => {
if (data.template[lang]) {
template[lang] = data.template[lang]
toggleNeedTemplate(true)
try {
const { data } = await getProblem(props.problemID)
toggleReady(true)
problem.value.id = data.id
problem.value._id = data._id
problem.value.title = data.title
problem.value.description = data.description
problem.value.input_description = data.input_description
problem.value.output_description = data.output_description
problem.value.time_limit = data.time_limit
problem.value.memory_limit = data.memory_limit
problem.value.memory_limit = data.memory_limit
problem.value.difficulty = data.difficulty
problem.value.visible = data.visible
problem.value.share_submission = data.share_submission
problem.value.tags = data.tags
problem.value.languages = data.languages
problem.value.template = data.template
problem.value.samples = data.samples
problem.value.samples = data.samples
problem.value.spj = data.spj
problem.value.spj_language = data.spj_language
problem.value.spj_code = data.spj_code
problem.value.spj_compile_ok = data.spj_compile_ok
problem.value.test_case_id = data.test_case_id
problem.value.test_case_score = data.test_case_score
problem.value.rule_type = data.rule_type
problem.value.hint = data.hint
problem.value.source = data.source
problem.value.io_mode = data.io_mode
if (problem.value.contest_id) {
problem.value.contest_id = problem.value.contest_id
}
})
// 标签
tags.value.select = data.tags
// 下面是用来显示的:
// 代码模板 和 模板开关
problem.value.languages.forEach((lang) => {
if (data.template[lang]) {
template[lang] = data.template[lang]
toggleNeedTemplate(true)
}
})
// 标签
tags.value.select = data.tags
} catch (error) {
message.error("获取题目失败")
router.push({ name: "admin problem list" })
}
}
async function getTagList() {

View File

@@ -2,7 +2,6 @@
import { NButton, NTag } from "naive-ui"
import { parseTime } from "~/utils/functions"
import { Server } from "~/utils/types"
import { usePermissions } from "~/utils/permissions"
import {
deleteJudgeServer,
editWebsite,
@@ -18,14 +17,6 @@ interface Testcase {
}
const message = useMessage()
const router = useRouter()
const { canManageSystemConfig } = usePermissions()
// 权限检查只有super_admin可以管理系统配置
if (!canManageSystemConfig.value) {
message.error("您没有权限访问此页面")
router.push("/admin")
}
const testcaseColumns: DataTableColumn<Testcase>[] = [
{ title: "测试用例 ID", key: "id" },

View File

@@ -3,7 +3,6 @@ import { NButton } from "naive-ui"
import { getRank } from "oj/api"
import Pagination from "~/shared/components/Pagination.vue"
import { useUserStore } from "~/shared/store/user"
import { usePermissions } from "~/utils/permissions"
import { getACRate } from "~/utils/functions"
import { Rank } from "~/utils/types"
import { getBaseInfo, randomUser10 } from "../api"
@@ -14,14 +13,6 @@ const contestCount = ref(0)
const userStore = useUserStore()
const router = useRouter()
const message = useMessage()
const { isSuperAdmin } = usePermissions()
// 权限检查只有super_admin可以访问管理员首页
if (!isSuperAdmin.value) {
message.error("您没有权限访问此页面")
router.push("/admin/problem/list")
}
const showModal = ref(false)
const luckyGuy = ref("")
const data = ref<Rank[]>([])

View File

@@ -3,7 +3,6 @@ import { DataTableRowKey, SelectOption } from "naive-ui"
import Pagination from "~/shared/components/Pagination.vue"
import { parseTime, filterEmptyValue } from "~/utils/functions"
import { User } from "~/utils/types"
import { usePermissions } from "~/utils/permissions"
import {
deleteUsers,
editUser,
@@ -18,13 +17,6 @@ import { USER_TYPE } from "~/utils/constants"
const message = useMessage()
const router = useRouter()
const route = useRoute()
const { canManageUsers } = usePermissions()
// 权限检查只有super_admin可以管理用户
if (!canManageUsers.value) {
message.error("您没有权限访问此页面")
router.push("/admin")
}
const total = ref(0)
const users = ref<User[]>([])