|
@@ -27,7 +27,7 @@
|
|
|
<div class="class">
|
|
|
<span>学员姓名</span>
|
|
|
<span>
|
|
|
- <input class="class-input" password="您的名字(选填)" type="text">
|
|
|
+ <input v-model="realName" class="class-input" password="您的名字(选填)" type="text" />
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="remind">答题后不可修改,累计错题扣分导致分数不及格时,系统自动交卷,考试不通过。</div>
|
|
@@ -40,9 +40,22 @@ import { useRoute } from "vue-router";
|
|
|
</script>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { defineEmits } from "vue";
|
|
|
+import { defineEmits, ref } from "vue";
|
|
|
+import { studentUserRealname } from "@/api/index";
|
|
|
+import { useStore } from "vuex";
|
|
|
const emits = defineEmits(["next"]);
|
|
|
-const gotoNextPage = () => void emits("next");
|
|
|
+let realName = ref("");
|
|
|
+const store = useStore()
|
|
|
+realName.value = store.getters.getRealName||""
|
|
|
+const gotoNextPage = () => {
|
|
|
+ if (realName.value&&store.getters.getRealName!==realName.value) {
|
|
|
+ studentUserRealname({
|
|
|
+ realName: realName.value,
|
|
|
+ }).then((res) => {});
|
|
|
+ }
|
|
|
+
|
|
|
+ emits("next");
|
|
|
+};
|
|
|
const { query } = useRoute();
|
|
|
</script>
|
|
|
|
|
@@ -77,13 +90,12 @@ const { query } = useRoute();
|
|
|
font-weight: 400;
|
|
|
}
|
|
|
}
|
|
|
-.class-input{
|
|
|
+.class-input {
|
|
|
width: 100px;
|
|
|
border: none;
|
|
|
background: #e2e2e2;
|
|
|
border-radius: 15px;
|
|
|
padding-left: 8px;
|
|
|
-
|
|
|
}
|
|
|
.content {
|
|
|
width: 345px;
|