mjh 4 лет назад
Родитель
Сommit
859e65e2c9

+ 1 - 1
src/views/AuthPage/components/AuthCard.vue

@@ -350,7 +350,7 @@ export default {
                     });
                     console.log(res);
                     setTimeout(() => {
-                      if (!res.data.redirectUri) {
+                      if (!res.data.data.redirectUri) {
                         if (this.$route.params.login_to) {
                           this.$router.push(String(this.$route.params.login_to));
                         } else {

+ 0 - 1
src/views/CoursePage/CourseDetail.vue

@@ -179,7 +179,6 @@ export default {
       this.$apis.getCourseById(this.$route.params.id)
         .then(res => {
           this.courseInfo = res.data.data;
-          this.coderExamForm.course = this.courseInfo.coderId;
           this.$apis.checkCourseSelection(this.$route.params.id, this.$store.state.user.id)
             .then(res => {
               this.isCourseSelected = res.data.data;

+ 6 - 21
src/views/CoursePage/tabs/TaskTab.vue

@@ -206,6 +206,7 @@ export default {
       themeColor,
       evalExamList: [],
       coderExamList: [],
+      courseName: "",
 
       //create Coder exam
       coderExamDialog: false,
@@ -264,10 +265,6 @@ export default {
     isStudent() {
       return this.$store.getters.isStudent;
     },
-    courseName() {
-      const res = this.$apis.getCourseById(this.courseId);
-      return res.data.data.name;
-    },
     problemTypeOptions() {
       return problemTypeOptions(true);
     },
@@ -278,6 +275,8 @@ export default {
   methods: {
     async init() {
       const _this = this;
+      _this.coderExamForm.course = _this.coderId;
+      _this.courseName = (await _this.$apis.getCourseById(_this.courseId)).data.data.name || "";
       if (_this.isTeacher) {
         if (_this.evalId !== null) {
           _this.evalExamList = (await _this.$apis.getTeacherEvalExamsByCourseId(_this.evalId)).data.data || [];
@@ -370,23 +369,9 @@ export default {
       window.open(url + "?id_token=" + this.$store.state.user.token);
     },
     // 创建Coder考试的Dialog
-    handleExamFormCancel(done) {
-      //关闭dialog的提示
-      ElMessageBox.confirm("是否确认退出?退出后将不保存表格信息。", "提示", {
-        confirmButtonText: "确认退出",
-        cancelButtonText: "我再想想",
-        type: "warning",
-        center: true,
-      })
-        .then(() => {
-          this.coderExamDialog = false;
-          // this.clearForm();
-          //TODO 清除表格信息
-          done();
-        })
-        .catch((err) => {
-          console.log(err);
-        });
+    handleExamFormCancel() {
+      this.coderExamDialog = false;
+      this.$refs.coderExamFormRef.resetFields();
     },
     // 展示Coder所有的problem题目(代码题)
     showProblemDialog() { //打开弹框,获取初始数据