Browse Source

题干内容包含 的大坑处理

刘洋 1 year ago
parent
commit
3189608820
2 changed files with 10 additions and 2 deletions
  1. 8 1
      src/features/OnlineExam/Examing/QuestionBody.vue
  2. 2 1
      vite.config.ts

+ 8 - 1
src/features/OnlineExam/Examing/QuestionBody.vue

@@ -56,11 +56,18 @@ function getAudioPlayedTimes(name: string) {
     store.exam.allAudioPlayTimes.find((a) => a.audioName === name)?.times ?? 0;
   return Math.max(examQuestion.limitedPlayTimes - playedTimes, 0);
 }
+
+function cutNbsp(str: string) {
+  if (typeof str !== "string") {
+    return str;
+  }
+  return (str || "").replace(/ /g, " ");
+}
 </script>
 
 <template>
   <div v-if="questionSegements" class="question-body">
-    <div v-html="questionSegements.text" />
+    <div v-html="cutNbsp(questionSegements.text)"></div>
 
     <div
       v-for="item in questionSegements.audios"

+ 2 - 1
vite.config.ts

@@ -7,7 +7,8 @@ import legacy from "@vitejs/plugin-legacy";
 import vueJsx from "@vitejs/plugin-vue-jsx";
 // import obfuscator from "rollup-plugin-obfuscator";
 
-const SERVER_URL = "https://192.168.10.240";
+// const SERVER_URL = "https://192.168.10.240";
+const SERVER_URL = "https://192.168.10.39";
 const path = require("path");
 
 const disableObfuse = process.env.DISABLE_OBFUSE;