Jelajahi Sumber

每日一题

weirdoheheelf 5 tahun lalu
induk
melakukan
07234cb891

+ 45 - 5
components/Navi.vue

@@ -3,18 +3,21 @@
     <div class="nav__body">
       <router-link to="/"><img src="/image/seec-logo--full.png" class="nav__logo" /></router-link>
       <ul class="nav__list nav__list-left">
-        <li class="nav__item nav__item-left"><a href="http://helper.seecoder.cn" target="_self">HELPER</a></li>
-        <li class="nav__item nav__item-left"><a href="http://coder.seecoder.cn" target="_self">CODER</a></li>
-        <li class="nav__item nav__item-left"><a href="http://developer.seecoder.cn" target="_self">DEVELOPER</a></li>
+        <li class="nav__item nav__item-left" id="v-step-0"><a href="http://helper.seecoder.cn" target="_self">HELPER</a></li>
+        <li class="nav__item nav__item-left" id="v-step-1"><a href="http://coder.seecoder.cn" target="_self">CODER</a></li>
+        <li class="nav__item nav__item-left" id="v-step-2"><a href="http://developer.seecoder.cn" target="_self">DEVELOPER</a></li>
       </ul>
       <el-input placeholder="搜索课程" class="nav__search" disabled>
         <el-button slot="append" icon="el-icon-search" disabled></el-button>
       </el-input>
       <ul class="nav__list nav__list-right" v-if="isLogin">
         <li class="nav__item">
-          <router-link to="/person/info" v-if="!isAdmin">个人中心</router-link>
+          <router-link to="/person/info" v-if="!isAdmin" id="v-step-3">个人中心</router-link>
           <router-link to="/admin/checkApplications" v-else>平台管理</router-link>
         </li>
+        <li class="nav__item">
+          <router-link to="/rookie/first" v-if="!isAdmin" id="v-step-4">通关模式</router-link>
+        </li>
         <li class="nav__item">
           <el-popover
             placement="bottom-start"
@@ -42,6 +45,7 @@
         <li class="nav__item"><router-link to="/login">登录</router-link></li>
         <li class="nav__item"><router-link to="/register">注册</router-link></li>
       </ul>
+      <v-tour name="myTour" :steps="steps" :options="myOptions"></v-tour>
     </div>
   </nav>
 </template>
@@ -55,10 +59,46 @@ export default {
       isTeacher: this.$store.state.user.role === 'TEACHER',
       isAdmin: this.$store.state.user.role === 'ADMIN',
       userName: this.$store.state.user.name,
-      userPhone: this.$store.state.user.phone
+      userPhone: this.$store.state.user.phone,
+      myOptions:{
+            useKeyboardNavigation: false,    //不使用←、→和ESC键来导航tour
+            startTimeout: 1000,   //1秒后执行
+            labels: {
+                buttonSkip: '跳过',
+                buttonPrevious: '上一步',
+                buttonNext: '下一步',
+                buttonStop: '关闭'
+            }
+        },
+        steps: [
+          {
+            target: '#v-step-0',  // We're using document.querySelector() under the hood
+            content: `这里是帮助,里面会有一些帮助你的文档`
+          },
+          {
+            target: '#v-step-1',
+            content: '这里是做题系统,可以在上面进行做题编程'
+          },
+          {
+            target: '#v-step-2',
+            content: '这里是开发平台',
+            
+          },
+          {
+            target: '#v-step-3',
+            content: '这里是个人中心,里面会有你的基本信息、学习数据等',
+            
+          },
+          {
+            target: '#v-step-4',
+            content: '这里是通关模式,你可以获取题库的推荐,进行每日一题的训练',
+            
+          }
+        ]
     }
   },
   mounted () {
+    this.$tours.myTour.start()
   },
 
   methods: {

+ 0 - 0
layouts/rookie.vue


+ 44 - 0
nginx.conf

@@ -88,6 +88,50 @@ http {
             proxy_read_timeout                 60s;
         }
 
+        location /apis {
+            proxy_pass                         http://47.111.95.164:8080/api;
+            proxy_http_version                 1.1;
+            proxy_cache_bypass                 $http_upgrade;
+
+
+            # Proxy headers
+            proxy_set_header Upgrade           $http_upgrade;
+            proxy_set_header Connection        $connection_upgrade;
+            proxy_set_header Host              $host;
+            proxy_set_header X-Real-IP         $remote_addr;
+            proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host  $host;
+            proxy_set_header X-Forwarded-Port  $server_port;
+
+            # Proxy timeouts
+            proxy_connect_timeout              60s;
+            proxy_send_timeout                 60s;
+            proxy_read_timeout                 60s;
+        }
+
+        location /apiss {
+            proxy_pass                         http://47.111.95.164:8080/api;
+            proxy_http_version                 1.1;
+            proxy_cache_bypass                 $http_upgrade;
+
+
+            # Proxy headers
+            proxy_set_header Upgrade           $http_upgrade;
+            proxy_set_header Connection        $connection_upgrade;
+            proxy_set_header Host              $host;
+            proxy_set_header X-Real-IP         $remote_addr;
+            proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host  $host;
+            proxy_set_header X-Forwarded-Port  $server_port;
+
+            # Proxy timeouts
+            proxy_connect_timeout              60s;
+            proxy_send_timeout                 60s;
+            proxy_read_timeout                 60s;
+        }
+
         # favicon.ico
         location = /favicon.ico {
             log_not_found off;

+ 18 - 1
nuxt.config.js

@@ -38,7 +38,10 @@ module.exports = {
     { src: '@/plugins/element-ui', ssr: true },
     { src: '~/plugins/vuex-persist', ssr: false },
     '~/plugins/api',
-    '~plugins/echarts'
+    '~/plugins/apis',
+    '~/plugins/apiss',
+    '~plugins/echarts',
+    '~/plugins/vue-tour'
   ],
   /*
   ** Nuxt.js dev-modules
@@ -86,6 +89,20 @@ module.exports = {
       // pathRewrite: {
       //   '^/api': ''
       // },
+    },
+    '/apis/':{
+      //target: 'http://localhost:5000',
+      target:'http://47.111.95.164:8080',
+      pathRewrite: {
+           '^/apis': '/api'
+         },
+    },
+    '/apiss/':{
+      //target: 'http://localhost:5000',
+      target:'http://47.111.95.164:8080',
+      pathRewrite: {
+           '^/apiss': '/api'
+         },
     }
   }
 

+ 1 - 0
package.json

@@ -33,6 +33,7 @@
     "request": "^2.88.2",
     "util": "^0.12.1",
     "vue": "^2.6.12",
+    "vue-tour": "^2.0.0",
     "vuex-persist": "^3.1.3"
   },
   "devDependencies": {

+ 2 - 1
pages/admin/checkApplications.vue

@@ -68,7 +68,7 @@ export default {
   },
   methods: {
     getApplications () {
-      this.$api.$get('/admin/getApplications').then((res) => {
+      this.$api.$get('/admin/getApplication').then((res) => {
         if (res.code === 0) {
           this.applications = res.data
         } else {
@@ -85,6 +85,7 @@ export default {
     },
     pass (row) {
       this.$api.$post('/admin/passApplication', { id: row.id, uid: row.uid }).then((res) => {
+        console.log(res.data)
         if (res.code === 0) {
           this.$message({
             showClose: true,

+ 1 - 0
pages/register.vue

@@ -236,6 +236,7 @@ export default {
         phone: this.phone,
         password: this.password,
         name: this.name,
+        username:this.username,
         email: this.email,
         identifyCode: this.identifyCode
       }).then((res) => {

+ 123 - 0
pages/rookie/basicResult.vue

@@ -0,0 +1,123 @@
+<template>
+    <div>
+        <div class="tab-container">
+      <el-card class="box-card">
+        <h1 style="text-align:center">基础测试结果展示</h1>
+        <el-divider></el-divider>
+        <el-table :data="tableData" border style="width: 100%">
+          <el-table-column prop="date" label="时间" width="180">
+          </el-table-column>
+          <el-table-column prop="name" label="考试号" width="360">
+          </el-table-column>
+          <el-table-column prop="address" label="成绩"> </el-table-column>
+        </el-table>
+        <div class="zhengwen">
+  <div class="button-style" ></div>
+  <el-button style="float: right" @click="back()"> 
+    回到首页
+  </el-button>
+  <el-button style="float: right" @click="go()"> 
+    每日一题
+  </el-button>
+  </div>
+      </el-card>
+    </div>
+    </div>
+</template>
+
+<style>
+
+.button-style{
+     padding: 20px 20px;
+  }
+.box-card {
+    width: 100%;
+    height: 80%;
+    padding: 40px 40px;
+  }
+.tab-container{
+    padding: 20px 20px;
+  }
+
+.text {
+  font-size: 20px;
+}
+
+.item {
+  margin-bottom: 18px;
+}
+
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
+.clearfix:after {
+  clear: both;
+}
+
+.body-style {
+  padding: "100px";
+}
+</style>
+
+<script>
+export default {
+  data() {
+    return {
+      examId:"935",
+      tableData: [
+        {
+          date: "",
+          name: "935",
+          address: "100",
+        },
+      ],
+    };
+  },
+  mounted(){
+    var date = new Date();
+    var year = date.getFullYear(); //月份从0~11,所以加一
+    var dateArr = [
+      date.getMonth() + 1,
+      date.getDate(),
+      date.getHours(),
+      date.getMinutes(),
+      date.getSeconds(),
+    ];
+    for (var i = 0; i < dateArr.length; i++) {
+      if (dateArr[i] >= 1 && dateArr[i] <= 9) {
+        dateArr[i] = "0" + dateArr[i];
+      }
+    }
+    var endTime =
+      year +
+      "-" +
+      dateArr[0] +
+      "-" +
+      dateArr[1] +
+      " " +
+      dateArr[2] +
+      ":" +
+      dateArr[3] +
+      ":" +
+      dateArr[4];
+      this.tableData[0].date=endTime;
+      this.examId=localStorage.getItem("examId");
+      this.tableData[0].name=localStorage.getItem("examId");
+      console.log(this.examId)
+      this.$apis.get("/report?examId="+this.examId).then((res)=>{
+      console.log(res.data.result.score)
+      this.tableData[0].address=res.data.result.score
+    });
+  },
+  methods:{
+      go(){
+          this.$router.push({path:'/rookie/daily'})
+      },
+      back(){
+          this.$router.push({path:'/'})
+      }
+  }
+}
+</script>

+ 128 - 0
pages/rookie/daily.vue

@@ -0,0 +1,128 @@
+<template>
+  <div>
+    <div class="tab-container">
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <h1>每日一题</h1>
+          <el-button
+            style="float: right; padding: 3px 0"
+            type="text"
+            @click="go()"
+            >去做题</el-button
+          >
+        </div>
+        <div>
+          {{ question.type }}
+        </div>
+      </el-card>
+    </div>
+  </div>
+</template>
+
+<style>
+.box-card {
+  width: 100%;
+  height: 80%;
+  padding: 40px 40px;
+}
+.tab-container {
+  padding: 20px 20px;
+}
+
+.text {
+  font-size: 20px;
+}
+
+.item {
+  margin-bottom: 18px;
+}
+
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
+.clearfix:after {
+  clear: both;
+}
+
+.body-style {
+  padding: "100px";
+}
+</style>
+
+
+<script>
+import { log } from "util";
+export default {
+  data() {
+    return {
+      activeIndex: "1",
+      question: {},
+      questionId: "",
+      redirect_uri: encodeURIComponent(
+        "http://p.seecoder.cn/rookie/dailyResult"
+      ),
+      teacher_token: "",
+      redirect_test_uri: encodeURIComponent(
+        "http://localhost:3000/rookie/dailyResult"
+      ),
+    };
+  },
+  mounted() {
+    let paramObj = {
+      learned: JSON.parse(localStorage.getItem("learned")),
+      interested: JSON.parse(localStorage.getItem("interested")),
+    };
+
+    this.$api.post("/rookie/daily", paramObj).then((res) => {
+      console.log(res.data.content);
+      this.questionId = res.data.content.id;
+      localStorage.setItem("questionId", res.data.content.id);
+      this.question = res.data.content;
+      localStorage.setItem("type", res.data.content.type);
+    });
+  },
+  methods: {
+    handleSelect(key, keyPath) {
+      console.log(key, keyPath);
+    },
+    go() {
+      var date = new Date();
+      var year = date.getFullYear(); //月份从0~11,所以加一
+      var dateArr = [
+        date.getMonth() + 1,
+        date.getDate(),
+        date.getHours(),
+        date.getMinutes(),
+        date.getSeconds(),
+      ];
+      for (var i = 0; i < dateArr.length; i++) {
+        if (dateArr[i] >= 0 && dateArr[i] <= 9) {
+          dateArr[i] = "0" + dateArr[i];
+        }
+      }
+      var startTime =
+        year +
+        "-" +
+        dateArr[0] +
+        "-" +
+        dateArr[1] +
+        " " +
+        dateArr[2] +
+        ":" +
+        dateArr[3] +
+        ":" +
+        dateArr[4];
+      localStorage.setItem("startTime", startTime);
+      window.location.href =
+        "http://eval.seec.seecoder.cn/singlequestion/" +
+        localStorage.getItem("questionId") +
+        "?redirect_uri=" +
+        this.redirect_test_uri +
+        "&id_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwLnNlZWNvZGVyLmNuIiwic3ViIjoiMTc3NjE3MDgxODEiLCJhdWQiOiJzZWVjLW1vb2MiLCJhdXRoX3RpbWUiOjE2MjEzNTQyOTUsImlhdCI6MTYyMTM1NDI5NSwiZXhwIjoxNjIxNDQwNjk1LCJ1c2VyX2luZm8iOnsicGhvbmUiOiIxNzc2MTcwODE4MSIsImVtYWlsIjoiMTE1ODQ5NDMxOEBxcS5jb20iLCJpZCI6MTM3MiwibmFtZSI6ImxpaGUiLCJyb2xlIjoiU1RVREVOVCJ9fQ.zXuO5z5w8Cj-DVrEyuTburP3eAssm2gpD0W8qzDTjx4"  
+        //+this.$store.state.token;
+    },
+  },
+};
+</script>

+ 181 - 0
pages/rookie/dailyResult.vue

@@ -0,0 +1,181 @@
+<template>
+  <div>
+    <div class="tab-container">
+      <el-card class="box-card">
+        <h1 style="text-align: center">每日一题结果展示</h1>
+        <div class="biaoge"></div>
+        <el-table :data="tableData" border style="width: 100%">
+          <el-table-column prop="date" label="时间" width="180">
+          </el-table-column>
+          <el-table-column prop="name" label="题号" width="360">
+          </el-table-column>
+          <el-table-column prop="address" label="结果"> </el-table-column>
+        </el-table>
+        <div class="biaoge"></div>
+        <el-table :data="tableData2" border style="width: 100%">
+          <el-table-column prop="pasted" label="已通过题目" width="180">
+          </el-table-column>
+          <el-table-column prop="notpasted" label="提交未通过题目" width="360">
+          </el-table-column>
+          <el-table-column prop="left" label="未开始题目"> </el-table-column>
+        </el-table>
+        <el-divider></el-divider>
+        <div style="text-align: center">恭喜你完成今天的题目!</div>
+        <div class="zhengwen">
+          <div class="button-style"></div>
+          <el-button style="float: right" @click="go()"> 继续做题 </el-button>
+          <div></div>
+          <el-button style="float: right" @click="back()"> 回到首页 </el-button>
+        </div>
+      </el-card>
+    </div>
+  </div>
+</template>
+
+<style>
+.biaoge{
+    padding-bottom: 15px;
+    padding-top:15px;
+}
+
+.button-style {
+  padding: 20px 20px;
+}
+.box-card {
+  width: 100%;
+  height: 80%;
+  padding: 40px 40px;
+}
+.tab-container {
+  padding: 20px 20px;
+}
+
+.text {
+  font-size: 20px;
+}
+
+.item {
+  margin-bottom: 18px;
+}
+
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
+.clearfix:after {
+  clear: both;
+}
+
+.body-style {
+  padding: "100px";
+}
+</style>
+
+<script>
+export default {
+  data() {
+    return {
+      answer: "",
+      trueAnswer: "",
+      tableData: [
+        {
+          date: "2021-05-14 03:54:17",
+          name: "956b5c4e-bf72-44dc-a64c-a47316e4c216",
+          address: "通过",
+        },
+      ],
+      tableData2: [
+        {
+          pasted: "214",
+          notpasted: "40",
+          left: "5219",
+        },
+      ],
+    };
+  },
+  mounted() {
+    var date = new Date();
+    var year = date.getFullYear(); //月份从0~11,所以加一
+    var dateArr = [
+      date.getMonth() + 1,
+      date.getDate(),
+      date.getHours(),
+      date.getMinutes(),
+      date.getSeconds(),
+    ];
+    for (var i = 0; i < dateArr.length; i++) {
+      if (dateArr[i] >= 0 && dateArr[i] <= 9) {
+        dateArr[i] = "0" + dateArr[i];
+      }
+    }
+    var endTime =
+      year +
+      "-" +
+      dateArr[0] +
+      "-" +
+      dateArr[1] +
+      " " +
+      dateArr[2] +
+      ":" +
+      dateArr[3] +
+      ":" +
+      dateArr[4];
+
+    let startTime = localStorage.getItem("startTime");
+    this.answer = this.$route.query.answer;
+    let questionId = localStorage.getItem("questionId");
+    console.log(questionId);
+    let paramObj = {
+      qid: questionId,
+      answer: this.answer,
+      startAt: startTime,
+      endAt: endTime,
+    };
+
+    console.log(paramObj);
+    this.$api.post("/rookie/daily/getDailyInfo", paramObj).then((res) => {
+      let paramObj1 = { records: res.data.content };
+      console.log(paramObj1)
+      
+      this.$apis
+        .post('/judge/objective/test',paramObj1)
+        .then((res) => {
+          console.log(res);
+          this.tableData[0].date = endTime;
+          let temp = JSON.stringify(res.data.result.result);
+          let temp1 = temp.split(":");
+          console.log(temp1)
+          this.tableData[0].name = temp1[0].substring(2, temp1[0].length - 1);
+          if(temp1[1].substring(0,temp1[1].length - 1)==='false'){
+              this.tableData[0].address ='未通过'
+          }
+          else{
+              this.tableData[0].address ='已通过'
+          }
+          this.$api.get("/rookie/daily/getUserQuestionInfo").then((res)=>{
+              this.tableData2[0].left=res.data.content.left
+              this.tableData2[0].pasted=res.data.content.pasted
+              this.tableData2[0].notpasted=res.data.content.notpasted
+          })
+        });
+      //}
+    });
+  },
+  methods: {
+    go() {
+      this.$router.push({ path: "/rookie/daily" });
+    },
+    back() {
+      this.$router.push({ path: "/" });
+    },
+    getResult() {
+      var url = location.search;
+      var theRequest = new Object();
+      if (url.indexOf("?") != -1) {
+        var str = url.substr(1);
+      }
+    },
+  },
+};
+</script>

+ 92 - 0
pages/rookie/first.vue

@@ -0,0 +1,92 @@
+<template>
+  <div class="tab-container">
+    <el-card class="box-card">
+      <h1 style="text-align:center">通关模式</h1>
+    <el-divider></el-divider>
+    <div class="zhengwen">
+    <div style="height: 300px">
+  <el-steps direction="vertical" :active="4">
+    <el-step title="步骤 1" description="填写基本信息"></el-step>
+    <el-step title="步骤 2" description="完成基础测试"></el-step>
+    <el-step title="步骤 3" description="测试结果分析"></el-step>
+    <el-step title="步骤 4" description="每日一题推荐"></el-step>
+  </el-steps>
+</div>
+    </div>
+  <div class="zhengwen">
+  <div class="button-style" ></div>
+  <el-button @click="go()"> 
+    欢迎开始!
+  </el-button>
+  </div>
+  
+</el-card>
+  </div>
+</template>
+
+<style>
+  .text {
+    font-size: 20px;
+  }
+
+  .item {
+    margin-bottom: 18px;
+  }
+
+  .clearfix:before,
+  .clearfix:after {
+    display: table;
+    content: "";
+  }
+  .clearfix:after {
+    clear: both
+  }
+
+  .box-card {
+    width: 100%;
+    height: 80%;
+    padding: 40px 40px;
+  }
+  .body-style {
+      padding:  40px 40px;
+  }
+
+  .zhengwen{
+    font-size:15px;
+    text-align:center;
+  }
+
+  .tab-container{
+    padding: 20px 20px;
+  }
+
+  .button-style{
+     padding: 20px 20px;
+  }
+</style>
+
+
+<script>
+  export default {
+    data() {
+      return {
+        activeIndex: '1',
+      };
+    },
+    methods: {
+      handleSelect(key, keyPath) {
+        console.log(key, keyPath);
+      },
+      go(){
+        this.$api.$get('/rookie/confirm',{}).then((res) => {
+            console.log(res)
+            if(res.content === 0){
+                this.$router.push({path:'/rookie/info'})
+            }else{
+                this.$router.push({path:'/rookie/daily'})
+            }
+        })
+      }
+    }
+  }
+</script>

+ 267 - 0
pages/rookie/info.vue

@@ -0,0 +1,267 @@
+<template>
+  <div class="tab-container">
+    <el-card class="box-card">
+      <h1 style="text-align: center">基本信息填写</h1>
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="180px"
+        class="demo-ruleForm"
+      >
+        <el-form-item label="方向" prop="direction">
+          <el-checkbox-group v-model="ruleForm.direction">
+            <el-checkbox label="前端" name="front">前端开发</el-checkbox>
+            <el-checkbox label="后端" name="back">后端开发</el-checkbox>
+            <el-checkbox label="数据库" name="data">数据库开发</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-form-item label="学习过的知识点" prop="learned">
+          <el-checkbox-group v-model="ruleForm.learned">
+            <el-checkbox label="软件需求" name="SR">软件需求</el-checkbox>
+            <el-checkbox label="软件设计" name="SD">软件设计</el-checkbox>
+            <el-checkbox label="软件构造" name="SC">软件构造</el-checkbox>
+            <el-checkbox label="软件测试" name="ST">软件测试</el-checkbox>
+            <el-checkbox label="软件维护" name="SM">软件维护</el-checkbox>
+            <el-checkbox label="软件配置管理" name="SCM"
+              >软件配置管理</el-checkbox
+            >
+            <el-checkbox label="软件工程管理" name="SEM"
+              >软件工程管理</el-checkbox
+            >
+            <el-checkbox label="软件工程过程" name="SEP"
+              >软件工程过程</el-checkbox
+            >
+            <el-checkbox label="软件工程模型与方法" name="SEMM"
+              >软件工程模型与方法</el-checkbox
+            >
+            <el-checkbox label="软件质量" name="SQ">软件质量</el-checkbox>
+            <el-checkbox label="软件工程职业实践" name="SEPP"
+              >软件工程职业实践</el-checkbox
+            >
+            <el-checkbox label="软件工程经济学" name="SEE"
+              >软件工程经济学</el-checkbox
+            >
+            <el-checkbox label="计算基础" name="CF">计算基础</el-checkbox>
+            <el-checkbox label="数学基础" name="MF">数学基础</el-checkbox>
+            <el-checkbox label="工程基础" name="EF">工程基础</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-form-item label="感兴趣的知识点" prop="interested">
+          <el-checkbox-group v-model="ruleForm.interested">
+            <el-checkbox label="软件需求" name="SR">软件需求</el-checkbox>
+            <el-checkbox label="软件设计" name="SD">软件设计</el-checkbox>
+            <el-checkbox label="软件构造" name="SC">软件构造</el-checkbox>
+            <el-checkbox label="软件测试" name="ST">软件测试</el-checkbox>
+            <el-checkbox label="软件维护" name="SM">软件维护</el-checkbox>
+            <el-checkbox label="软件配置管理" name="SCM"
+              >软件配置管理</el-checkbox
+            >
+            <el-checkbox label="软件工程管理" name="SEM"
+              >软件工程管理</el-checkbox
+            >
+            <el-checkbox label="软件工程过程" name="SEP"
+              >软件工程过程</el-checkbox
+            >
+            <el-checkbox label="软件工程模型与方法" name="SEMM"
+              >软件工程模型与方法</el-checkbox
+            >
+            <el-checkbox label="软件质量" name="SQ">软件质量</el-checkbox>
+            <el-checkbox label="软件工程职业实践" name="SEPP"
+              >软件工程职业实践</el-checkbox
+            >
+            <el-checkbox label="软件工程经济学" name="SEE"
+              >软件工程经济学</el-checkbox
+            >
+            <el-checkbox label="计算基础" name="CF">计算基础</el-checkbox>
+            <el-checkbox label="数学基础" name="MF">数学基础</el-checkbox>
+            <el-checkbox label="工程基础" name="EF">工程基础</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="submitForm('ruleForm')"
+            >提交</el-button
+          >
+          <el-button @click="resetForm('ruleForm')">重置</el-button>
+          <el-button @click="goBack()">返回</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+<style>
+.text {
+  font-size: 14px;
+}
+
+.item {
+  padding: 18px 0px;
+}
+
+.box-card {
+  width: 100%;
+  height: 80%;
+  padding: 20px 20px;
+}
+.tab-container {
+  padding: 20px 20px;
+}
+</style>
+<script>
+export default {
+  data() {
+    return {
+      ruleForm: {
+        learned: ["软件需求", "软件设计", "软件构造"],
+        interested: ["计算基础", "数学基础", "工程基础"],
+        direction: ["前端"],
+      },
+      rules: {
+        learned: [
+          {
+            type: "array",
+            required: true,
+            message: "请至少选择一个课程",
+            trigger: "change",
+          },
+        ],
+        interested: [
+          {
+            type: "array",
+            required: true,
+            message: "请至少选择一个课程",
+            trigger: "change",
+          },
+        ],
+      },
+      examId: "",
+      questionScoreMap: {},
+      redirect_uri: encodeURIComponent(
+        "http://p.seecoder.cn/rookie/basicResult"
+      ),
+      teacher_token: "",
+      redirect_test_uri: encodeURIComponent(
+        "http://localhost:3000/rookie/basicResult"
+      ),
+    };
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let paramObj = this.ruleForm;
+          localStorage.setItem("learned", JSON.stringify(paramObj.learned));
+          localStorage.setItem(
+            "interested",
+            JSON.stringify(paramObj.interested)
+          );
+          alert("submit!");
+          this.$api.post("/rookie/info", paramObj);
+          this.$api.get("/rookie/virtualTeacher").then((res) => {
+            console.log(res.data.content.token);
+            console.log(this.$store.state.token);
+            this.teacher_token = res.data.content.token;
+            this.$api.post("/rookie/basicTest", paramObj).then((res) => {
+              console.log(res.data.content);
+              this.questionScoreMap = res.data.content;
+              var date = new Date();
+              var year = date.getFullYear(); //月份从0~11,所以加一
+              var dateArr = [
+                date.getMonth() + 1,
+                date.getDate(),
+                date.getHours(),
+                date.getMinutes(),
+                date.getSeconds(),
+              ];
+              var endDateArr=[
+                date.getMonth() + 1,
+                date.getDate(),
+                date.getHours()+2,
+                date.getMinutes()+1,
+                date.getSeconds(),
+              ];;
+              for (var i = 0; i < dateArr.length; i++) {
+                if (dateArr[i] >= 0 && dateArr[i] <= 9) {
+                  dateArr[i] = "0" + dateArr[i];
+                  
+                }
+                if(endDateArr[i]>=0 && endDateArr[i]<=9){
+                  endDateArr[i]="0"+endDateArr[i];
+                }
+              }
+              var startTime =
+                year +
+                "-" +
+                dateArr[0] +
+                "-" +
+                dateArr[1] +
+                " " +
+                dateArr[2] +
+                ":" +
+                dateArr[3] +
+                ":" +
+                dateArr[4];
+              var endTime=year +
+                "-" +
+                endDateArr[0] +
+                "-" +
+                endDateArr[1] +
+                " " +
+                endDateArr[2] +
+                ":" +
+                endDateArr[3] +
+                ":" +
+                endDateArr[4];
+              let examObj = {
+                antiCheating: true,
+                comment: "通关模式基础测试",
+                difficulty: 1,
+                endTime: endTime,
+                examName: "通关模式基础测试",
+                isPublic: true,
+                position: "string",
+                skills: [],
+                startTime: startTime,
+              };
+              console.log(examObj)
+              this.$apiss.post("/exam", examObj).then((res1) => {
+                console.log(res1.data.result.examId);
+                this.examId = res1.data.result.examId;
+                localStorage.setItem("examId", res1.data.result.examId);
+                console.log(this.questionScoreMap);
+                let questionMap={
+                  questionScoreMap:this.questionScoreMap
+                }
+                console.log(questionMap)
+                //window.location.href = 'http://localhost:8000/exam/935/exam-pane?redirect_uri='+this.redirect_test_uri
+                this.$apiss
+                  .put("/exam/" + this.examId + "/questions/", questionMap)
+                  .then((res2) => {
+                    //window.location.href = 'http://localhost:8000/exam/935/exam-pane?redirect_uri=http%3A%2F%2Fwww.baidu.com'
+                    //window.location.href='http://testeval.seec.seecoder.cn/exam/'+this.examId+'/exam-pane?'+this.redirect_uri+'&id_token='+this.$store.state.token
+                    window.location.href =
+                      "http://eval.seec.seecoder.cn/exam/" +
+                      this.examId +
+                      "/exam-pane?redirect_uri=" +
+                      this.redirect_test_uri +
+                      "&id_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwLnNlZWNvZGVyLmNuIiwic3ViIjoiMTc3NjE3MDgxODEiLCJhdWQiOiJzZWVjLW1vb2MiLCJhdXRoX3RpbWUiOjE2MjEzNTQyOTUsImlhdCI6MTYyMTM1NDI5NSwiZXhwIjoxNjIxNDQwNjk1LCJ1c2VyX2luZm8iOnsicGhvbmUiOiIxNzc2MTcwODE4MSIsImVtYWlsIjoiMTE1ODQ5NDMxOEBxcS5jb20iLCJpZCI6MTM3MiwibmFtZSI6ImxpaGUiLCJyb2xlIjoiU1RVREVOVCJ9fQ.zXuO5z5w8Cj-DVrEyuTburP3eAssm2gpD0W8qzDTjx4" 
+                      //+this.$store.state.token;
+                  });
+              });
+            });
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    resetForm(formName) {
+      this.$refs[formName].resetFields();
+    },
+    goBack() {
+      this.$router.push("/rookie");
+    },
+  },
+};
+</script>

+ 48 - 0
plugins/apis.js

@@ -0,0 +1,48 @@
+
+export default function ({ $axios, redirect, app, store }, inject) {
+    
+    // Create a custom axios instance
+    const apis = $axios.create({
+      // headers: {
+      //   common: {
+      //     Accept: 'text/plain, */*'
+      //   }
+      // },
+      baseURL: '/apis',
+      timeout: 10000,
+      withCredentials: true
+    })
+  
+    apis.onRequest(config => {
+      if (store.state.token) {
+        config.headers.authorization = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwLnNlZWNvZGVyLmNuIiwic3ViIjoiMTc3NjE3MDgxODEiLCJhdWQiOiJzZWVjLW1vb2MiLCJhdXRoX3RpbWUiOjE2MjE1MDU4MjgsImlhdCI6MTYyMTUwNTgyOCwiZXhwIjoxNjIxNTkyMjI4LCJ1c2VyX2luZm8iOnsicGhvbmUiOiIxNzc2MTcwODE4MSIsImVtYWlsIjoiMTE1ODQ5NDMxOEBxcS5jb20iLCJpZCI6MTM3MiwibmFtZSI6ImxpaGUiLCJyb2xlIjoiU1RVREVOVCJ9fQ.VDkWe9cNEr9bUv0IlGF0sHjIjEKsfk-YVfzCAV2ymnk"
+      } else {
+        delete config.headers.authorization
+      }
+  
+      return config
+    })
+  
+    apis.setHeader('Content-Type', 'application/json')
+  
+    apis.onResponse(response => {
+      if (response.status === 401) {
+        store.commit('saveToken', null)
+        store.commit('saveUser', {})
+        redirect('/unauthorized')
+      }
+    })
+  
+    apis.onError(error => {
+      if (error.response.status === 401) {
+        store.commit('saveToken', null)
+        store.commit('saveUser', {})
+        redirect('/unauthorized')
+      }
+    })
+  
+    
+    // Inject to context as $apis
+    inject('apis', apis)
+  }
+  

+ 49 - 0
plugins/apiss.js

@@ -0,0 +1,49 @@
+
+export default function ({ $axios, redirect, app, store }, inject) {
+    
+    // Create a custom axios instance
+    const apiss = $axios.create({
+      // headers: {
+      //   common: {
+      //     Accept: 'text/plain, */*'
+      //   }
+      // },
+      baseURL: '/apiss',
+      timeout: 10000,
+      withCredentials: true
+    })
+  
+    apiss.onRequest(config => {
+      if (store.state.token) {
+        config.headers.authorization = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwLnNlZWNvZGVyLmNuIiwic3ViIjoiMTgwMDE1ODUyNjciLCJhdWQiOiJzZWVjLW1vb2MiLCJhdXRoX3RpbWUiOjE2MjE1MDU3NDcsImlhdCI6MTYyMTUwNTc0NywiZXhwIjoxNjIxNTkyMTQ3LCJ1c2VyX2luZm8iOnsicGhvbmUiOiIxODAwMTU4NTI2NyIsImVtYWlsIjoicWlubGl1QG5qdS5lZHUuY24iLCJpZCI6NDI5LCJuYW1lIjoia2Vubnk2N25qdSIsInJvbGUiOiJURUFDSEVSIn19.l0YjHU9xm1MjyVpaX3OoPhExYAIn1qzDoJemeOloVww"
+
+      } else {
+        delete config.headers.authorization
+      }
+  
+      return config
+    })
+  
+    apiss.setHeader('Content-Type', 'application/json')
+  
+    apiss.onResponse(response => {
+      if (response.status === 401) {
+        store.commit('saveToken', null)
+        store.commit('saveUser', {})
+        redirect('/unauthorized')
+      }
+    })
+  
+    apiss.onError(error => {
+      if (error.response.status === 401) {
+        store.commit('saveToken', null)
+        store.commit('saveUser', {})
+        redirect('/unauthorized')
+      }
+    })
+  
+    
+    // Inject to context as $apiss
+    inject('apiss', apiss)
+  }
+  

+ 5 - 0
plugins/vue-tour.js

@@ -0,0 +1,5 @@
+import Vue from 'vue'
+import VueTour from 'vue-tour'
+require('vue-tour/dist/vue-tour.css')
+
+Vue.use(VueTour)