|
|
@@ -20,7 +20,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row class="teacher">
|
|
|
- 教师: {{ coderVO.creator.username }}
|
|
|
+ 教师: {{ teacher.name }}
|
|
|
</el-row>
|
|
|
<el-row class="course">
|
|
|
所属课程: {{ coderVO.course }}
|
|
|
@@ -49,6 +49,16 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ teacher: {
|
|
|
+ type: Object,
|
|
|
+ default: {
|
|
|
+ name: "暂无信息",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
computed: {
|
|
|
state: function () {
|
|
|
if (this.coderVO.status === "CLOSED") {
|
|
|
@@ -65,7 +75,13 @@ export default {
|
|
|
return this.$store.state.user.role === "TEACHER";
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ async mounted() {
|
|
|
+ const res = await this.$apis.getUserAPI(this.coderVO.creator.id);
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.teacher = res.data.data;
|
|
|
+ } else {
|
|
|
+ this.teacher = {name: this.coderVO.creator.username};
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
timestampToTime(timestamp) {
|
|
|
@@ -86,10 +102,10 @@ export default {
|
|
|
let cancelButtonText = "让我想想";
|
|
|
let nextURL = "";
|
|
|
if (this.isTeacher) {
|
|
|
- if(this.$store.state.user.id === this.coderVO.id){
|
|
|
+ if (this.$store.state.user.id === this.coderVO.id) {
|
|
|
nextURL = "https://coder.seec.seecoder.cn/exam/" + this.coderVO.id + "?id_token=" + this.$store.state.user.token;
|
|
|
window.open(nextURL);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessage.error("无权访问其他教师创建的测试");
|
|
|
}
|
|
|
} else {
|