Przeglądaj źródła

[修改]问题关键字查找接口

soleil 7 lat temu
rodzic
commit
783f76ef74
3 zmienionych plików z 17 dodań i 5 usunięć
  1. 13 1
      src/api/question.js
  2. 2 2
      src/views/teacher/Question/index.vue
  3. 2 2
      vue.config.js

+ 13 - 1
src/api/question.js

@@ -32,7 +32,19 @@ export const getQuestionByQuesType = ({ type, page, limit }) => {
 };
 
 /**
- * 根据关键字进行查找
+ * 根据关键字及问题分类进行查找
+ * @param {string} keyword
+ * @param {string} type
+ * @returns {Promise<{data:QuestionSerializer[]}>}
+ */
+export const getTeacherKeywordQuestionsByType = (keyword = "", type = "") => {
+  return request(
+    `${QUESTION_MODULE}/teacher/keyword?keyword=${keyword}&type=${type}`
+  );
+};
+
+/**
+ * 根据关键字及问题分类进行查找
  * @param {string} keyword
  * @param {string} type
  * @returns {Promise<{data:QuestionSerializer[]}>}

+ 2 - 2
src/views/teacher/Question/index.vue

@@ -438,7 +438,7 @@ import { mapState } from "vuex";
 import {
   getQuestionsByAssignType,
   getTeacherQuestionType,
-  getTeacherKeywordQuestions,
+  getTeacherKeywordQuestionsByType,
   getQuestionByQuesType
 } from "@/api/question";
 import PageHeader from "@/components/PageHeader";
@@ -576,7 +576,7 @@ export default {
     },
     //根据关键字查找题目
     getQuestionsByKey() {
-      getTeacherKeywordQuestions(this.keyWord)
+      getTeacherKeywordQuestionsByType(this.keyWord, "")
         .then(value => {
           this.data = value.data;
         })

+ 2 - 2
vue.config.js

@@ -2,8 +2,8 @@ module.exports = {
   devServer: {
     proxy: {
       "^/api": {
-        target: "http://localhost:4000/",
-        // target: "http://10.1.1.198:8080/",
+        // target: "http://localhost:4000/",
+        target: "http://10.1.1.198:8080/",
         // target: "http://192.168.0.101:8080",
         // target: "http://10.1.2.3:8080/",