Pārlūkot izejas kodu

后台接口升级

Michael Wang 6 gadi atpakaļ
vecāks
revīzija
3482ea2be2

+ 3 - 2
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -36,9 +36,10 @@ const { mapState, mapMutations, mapGetters } = createNamespacedHelpers(
 
 
 export default {
 export default {
   name: "ExamingHome",
   name: "ExamingHome",
-  async created() {
-    await this.initData();
+  created() {
+    this.initData();
     if (!this.$route.query.examQuestionId) {
     if (!this.$route.query.examQuestionId) {
+      // created can access this.$route?
       this.$router.push(
       this.$router.push(
         this.$route.fullPath + "&examQuestionId=" + this.examQuestionList[0].id
         this.$route.fullPath + "&examQuestionId=" + this.examQuestionList[0].id
       );
       );

+ 12 - 17
src/features/OnlineExam/OnlineExamFaceCheckModal.vue

@@ -44,29 +44,24 @@ export default {
     course: Object
     course: Object
   },
   },
   async created() {
   async created() {
-    const res = await this.$http.get("/api/ecs_core/student/getStudentInfo", {
-      params: {
-        identityNumber: this.$store.state.user.identityNumber,
-        orgId: this.$store.state.user.rootOrgId
-      }
-    });
+    const res = await this.$http.get(
+      "/api/ecs_core/student/getStudentInfoBySession"
+    );
     this.userPhoto = res.data.photoPath;
     this.userPhoto = res.data.photoPath;
     // FIXME: 以后api返回的是绝对路径
     // FIXME: 以后api返回的是绝对路径
     if (this.userPhoto.startsWith("http") === false) {
     if (this.userPhoto.startsWith("http") === false) {
-      this.userPhoto =
-        "https://ecs-test-static.qmth.com.cn/student_base_photo/" +
-        this.userPhoto;
+      this.userPhoto = this.userPhoto;
     }
     }
 
 
-    const sysRes = await this.$http.get("/api/sys_param", {
-      params: {
-        orgId: this.$store.state.user.rootOrgId
-      }
-    });
+    // const sysRes = await this.$http.get("/api/sys_param", {
+    //   params: {
+    //     orgId: this.$store.state.user.rootOrgId
+    //   }
+    // });
 
 
-    // FIXME: 将faceEnable和faceCheck放到global的state中
-    this.faceEnable = sysRes.data.faceEnable; // 模拟练习?
-    this.faceCheck = sysRes.data.faceCheck; // 考试
+    // // FIXME: 将faceEnable和faceCheck放到global的state中
+    // this.faceEnable = sysRes.data.faceEnable; // 模拟练习?
+    // this.faceCheck = sysRes.data.faceCheck; // 考试
   },
   },
   computed: {
   computed: {
     ...mapState(["faceCheckModalOpen"])
     ...mapState(["faceCheckModalOpen"])

+ 3 - 1
src/features/OnlineExam/OnlineExamHome.vue

@@ -27,7 +27,9 @@ export default {
     // go to /online-exam/exam/:id/start
     // go to /online-exam/exam/:id/start
     // Promise.all
     // Promise.all
 
 
-    const res = await this.$http.get("/api/online_exam_course");
+    const res = await this.$http.get(
+      "/api/ecs_oe_student/examControl/queryExamList"
+    );
 
 
     this.courses = res.data;
     this.courses = res.data;
   },
   },

+ 7 - 10
src/features/OnlineExam/OnlineExamList.vue

@@ -16,16 +16,13 @@
           <td>{{ course.startTime }} <br> ~ <br> {{ course.endTime }}</td>
           <td>{{ course.startTime }} <br> ~ <br> {{ course.endTime }}</td>
           <td>{{ course.allowExamCount }}</td>
           <td>{{ course.allowExamCount }}</td>
           <td style="min-width: 180px">
           <td style="min-width: 180px">
-            <template v-if="course.isvalid">
-              <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px">
-                <i-button class="qm-primary-button" :disabled="!courseInBetween(course)" @click="enterExam(course)">进入考试</i-button>
-
-                <i-poptip trigger="hover" placement="left" class="online-exam-list-override-poptip">
-                  <i-button class="qm-primary-button" style="width: 100%">客观分</i-button>
-                  <ecs-online-exam-result-list slot="content" :results="[{startTime: '2018-06-03 12:00:00', endTime: '2018-06-04 14:00:00', score: 100}]"></ecs-online-exam-result-list>
-                </i-poptip>
-              </div>
-            </template>
+            <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px">
+              <i-button class="qm-primary-button" :disabled="!courseInBetween(course)" @click="enterExam(course)">进入考试</i-button>
+              <i-poptip trigger="hover" placement="left" class="online-exam-list-override-poptip">
+                <i-button class="qm-primary-button" style="width: 100%">客观分</i-button>
+                <ecs-online-exam-result-list slot="content" :results="[{startTime: '2018-06-03 12:00:00', endTime: '2018-06-04 14:00:00', score: 100}]"></ecs-online-exam-result-list>
+              </i-poptip>
+            </div>
           </td>
           </td>
         </tr>
         </tr>
       </tbody>
       </tbody>

+ 2 - 2
src/features/login/Login.vue

@@ -23,12 +23,12 @@
           <i-form ref="loginForm" :model="loginForm" :rules="loginFormRule">
           <i-form ref="loginForm" :model="loginForm" :rules="loginFormRule">
             <i-form-item prop="accountValue" style='margin-bottom:35px;height:42px'>
             <i-form-item prop="accountValue" style='margin-bottom:35px;height:42px'>
               <i-input type="text" size="large" v-model="loginForm.accountValue" placeholder="登录账号">
               <i-input type="text" size="large" v-model="loginForm.accountValue" placeholder="登录账号">
-                <i-icon type="person" slot="prepend"></i-icon>
+                <i-icon type="ios-person" slot="prepend"></i-icon>
               </i-input>
               </i-input>
             </i-form-item>
             </i-form-item>
             <i-form-item prop="password" style='margin-bottom:35px;height:42px'>
             <i-form-item prop="password" style='margin-bottom:35px;height:42px'>
               <i-input type="password" size="large" v-model="loginForm.password" placeholder="密码" @on-enter="login('loginForm')">
               <i-input type="password" size="large" v-model="loginForm.password" placeholder="密码" @on-enter="login('loginForm')">
-                <i-icon type="locked" slot="prepend"></i-icon>
+                <i-icon type="ios-lock" slot="prepend"></i-icon>
               </i-input>
               </i-input>
             </i-form-item>
             </i-form-item>
             <i-form-item>
             <i-form-item>

+ 3 - 1
tests/vue/child.vue

@@ -3,6 +3,7 @@
     <button @click="$emit('countChange', counte++)">emit value</button>
     <button @click="$emit('countChange', counte++)">emit value</button>
     <div>from parent: {{passToChild}} </div>
     <div>from parent: {{passToChild}} </div>
     <div>from parent to computed: {{computedFromProps}} </div>
     <div>from parent to computed: {{computedFromProps}} </div>
+    <div>from parent to data: {{dataFromProps}} </div>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -14,7 +15,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      counte: 0
+      counte: 0,
+      dataFromProps: "data: " + this.passToChild // non reactive
     };
     };
   },
   },
   computed: {
   computed: {

+ 34 - 50
vue.config.js

@@ -1,61 +1,45 @@
 let proxy = {
 let proxy = {
-  "/api/ecs_core": {
-    target: "http://ecs-dev.qmth.com.cn:8000", //代理跨域转地址,基础信息
-    changeOrigin: true
-  },
-  // "/api/logic/portal": {
-  //   target: " http://ecs-dev.qmth.com.cn:8018", //基础信息 门户 王伟
-  //   changeOrigin: true
-  // },
-  "/api/ecs_exam_work": {
-    target: "http://ecs-dev.qmth.com.cn:8001", // 考务 王伟
-    changeOrigin: true
-  },
-  // "/api/ecs_outlet": {
-  //   target: " http://ecs-dev.qmth.com.cn:8007", //  王伟
-  //   changeOrigin: true
-  // },
-  "/facepp_api": {
-    target: "http://ecs-dev.qmth.com.cn:8898", // 陈恳
+  "/api": {
+    target: "http://192.168.10.39:8878", // 考务 王伟
     changeOrigin: true
     changeOrigin: true
   }
   }
 };
 };
 
 
-const stu = [
-  "/api/ecs_oe",
-  "/api/online_exam_course",
-  "/api/sys_param",
-  "/api/exam_record",
-  "/api/exam_control",
-  "/api/exam_question",
-  "/api/exam_score",
-  "/api/practice_course",
-  "/api/practice_detail",
-  "/api/practice_record",
-  "/api/exam_captures",
-  "/api/face_capture",
-  "/api/face_verify",
-  "/api/offline_exam"
-];
+// const stu = [
+//   "/api/ecs_oe",
+//   "/api/ecs_oe_student/",
+//   "/api/sys_param",
+//   "/api/exam_record",
+//   "/api/exam_control",
+//   "/api/exam_question",
+//   "/api/exam_score",
+//   "/api/practice_course",
+//   "/api/practice_detail",
+//   "/api/practice_record",
+//   "/api/exam_captures",
+//   "/api/face_capture",
+//   "/api/face_verify",
+//   "/api/offline_exam"
+// ];
 
 
-for (const s of stu) {
-  proxy[s] = {
-    target: "http://ecs-dev.qmth.com.cn:8003", // 陈恳
-    changeOrigin: true
-  };
-}
+// for (const s of stu) {
+//   proxy[s] = {
+//     target: "http://ecs-dev.qmth.com.cn:8003", // 陈恳
+//     changeOrigin: true
+//   };
+// }
 
 
-const mock = [{ source: "/api/mock/exam_question", dest: "/examQuestions" }];
+// const mock = [{ source: "/api/mock/exam_question", dest: "/examQuestions" }];
 
 
-for (const m of mock) {
-  proxy[m.source] = {
-    target: "http://localhost:3000/",
-    changeOrigin: true,
-    pathRewrite: {
-      ".*": m.dest
-    }
-  };
-}
+// for (const m of mock) {
+//   proxy[m.source] = {
+//     target: "http://localhost:3000/",
+//     changeOrigin: true,
+//     pathRewrite: {
+//       ".*": m.dest
+//     }
+//   };
+// }
 
 
 var webpack = require("webpack");
 var webpack = require("webpack");
 module.exports = {
 module.exports = {