diff --git a/src/oj/problem/components/Form.vue b/src/oj/problem/components/Form.vue
index 70d362e..6930f7a 100644
--- a/src/oj/problem/components/Form.vue
+++ b/src/oj/problem/components/Form.vue
@@ -10,7 +10,7 @@ import storage from "~/utils/storage"
import { LANGUAGE } from "~/utils/types"
import Submit from "./Submit.vue"
import StatisticsPanel from "~/shared/components/StatisticsPanel.vue"
-import {Icon} from "@iconify/vue"
+import IconButton from "~/shared/components/IconButton.vue"
interface Props {
storageKey: string
@@ -145,11 +145,12 @@ function showStatisticsPanel() {
操作
-
-
-
-
-
+
- {{ "搜索" + props.type}}
+ {{ "搜索" + props.type }}
diff --git a/src/oj/submission/list.vue b/src/oj/submission/list.vue
index 61f4947..2120c5b 100644
--- a/src/oj/submission/list.vue
+++ b/src/oj/submission/list.vue
@@ -15,7 +15,7 @@ import ButtonWithSearch from "./components/ButtonWithSearch.vue"
import StatisticsPanel from "~/shared/components/StatisticsPanel.vue"
import SubmissionLink from "./components/SubmissionLink.vue"
import SubmissionDetail from "./detail.vue"
-import { Icon } from "@iconify/vue"
+import IconButton from "~/shared/components/IconButton.vue"
interface SubmissionQuery {
username: string
@@ -301,11 +301,11 @@ const columns = computed(() => {
-
-
-
-
-
+
diff --git a/src/shared/components/Hitokoto.vue b/src/shared/components/Hitokoto.vue
index f639215..0cc48cc 100644
--- a/src/shared/components/Hitokoto.vue
+++ b/src/shared/components/Hitokoto.vue
@@ -7,9 +7,14 @@ const hitokoto = reactive({
})
async function receive() {
- const res = await getHitokoto()
- hitokoto.sentence = res.data.hitokoto
- hitokoto.from = res.data.from
+ try {
+ const res = await getHitokoto()
+ hitokoto.sentence = res.data.hitokoto
+ hitokoto.from = res.data.from
+ } catch (error) {
+ hitokoto.sentence = "获取一言失败,请点击重试"
+ hitokoto.from = "DEV"
+ }
}
onMounted(receive)
diff --git a/src/shared/components/IconButton.vue b/src/shared/components/IconButton.vue
new file mode 100644
index 0000000..b672330
--- /dev/null
+++ b/src/shared/components/IconButton.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+ {{ tip }}
+
+
+
diff --git a/src/utils/registerChart.ts b/src/utils/registerChart.ts
index d59a1bf..4550742 100644
--- a/src/utils/registerChart.ts
+++ b/src/utils/registerChart.ts
@@ -1,36 +1,36 @@
-import {
- ArcElement,
- BarElement,
- BarController,
- CategoryScale,
- Chart as ChartJS,
- Colors,
- Legend,
- LinearScale,
- LineController,
- Title,
- Tooltip,
- LineElement,
- PointElement,
-} from "chart.js"
-
-let registered = false
-
-export function registerChart() {
- if (registered) return
- ChartJS.register(
- CategoryScale,
- LinearScale,
- BarElement,
- BarController,
- ArcElement,
- LineElement,
- LineController,
- PointElement,
- Colors,
- Title,
- Tooltip,
- Legend,
- )
- registered = true
-}
+import {
+ ArcElement,
+ BarElement,
+ BarController,
+ CategoryScale,
+ Chart as ChartJS,
+ Colors,
+ Legend,
+ LinearScale,
+ LineController,
+ Title,
+ Tooltip,
+ LineElement,
+ PointElement,
+} from "chart.js"
+
+let registered = false
+
+export function registerChart() {
+ if (registered) return
+ ChartJS.register(
+ CategoryScale,
+ LinearScale,
+ BarElement,
+ BarController,
+ ArcElement,
+ LineElement,
+ LineController,
+ PointElement,
+ Colors,
+ Title,
+ Tooltip,
+ Legend,
+ )
+ registered = true
+}
diff --git a/src/utils/types.ts b/src/utils/types.ts
index 2a26699..b829b9e 100644
--- a/src/utils/types.ts
+++ b/src/utils/types.ts
@@ -118,7 +118,7 @@ export interface Problem {
difficulty: "Low" | "Mid" | "High"
source: string
prompt: string
- answers: {language: LANGUAGE, code: string}[]
+ answers: { language: LANGUAGE; code: string }[]
total_score: number
submission_number: number
accepted_number: number