Explorar el Código

[修改]解决控制台courseId报错

soleil hace 7 años
padre
commit
3ee0f281bb
Se han modificado 2 ficheros con 5 adiciones y 11 borrados
  1. 3 9
      src/components/AssignmentCRUD/CreateAssignment/index.vue
  2. 2 2
      vue.config.js

+ 3 - 9
src/components/AssignmentCRUD/CreateAssignment/index.vue

@@ -176,7 +176,7 @@ import { difficultyClass } from "@/data/questionDifficulty";
 export default {
   props: {
     courseId: {
-      type: String
+      type: Number
     },
     assignType: {
       type: Number
@@ -279,16 +279,10 @@ export default {
         this.parseParams();
         if (this.assignType === 1) {
           // 文档作业
-          this.myPromise = postDocAssignment(
-            this.params,
-            parseInt(this.courseId)
-          );
+          this.myPromise = postDocAssignment(this.params, this.courseId);
         } else {
           // 代码作业
-          this.myPromise = postCodeAssignment(
-            this.params,
-            parseInt(this.courseId)
-          );
+          this.myPromise = postCodeAssignment(this.params, this.courseId);
         }
         this.myPromise.then(res => {
           //创建成功

+ 2 - 2
vue.config.js

@@ -2,8 +2,8 @@ module.exports = {
   devServer: {
     proxy: {
       "^/api": {
-        target: "http://localhost:4000/",
-        // target: "http://10.1.2.2:8080/",
+        // target: "http://localhost:4000/",
+        target: "http://10.1.1.198:8080/",
         ws: true,
         changeOrigin: true
       }