|
@@ -24,9 +24,39 @@ export default {
|
|
name: "OnlineExamHome",
|
|
name: "OnlineExamHome",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ previousUrl: "",
|
|
courses: []
|
|
courses: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ beforeRouteEnter(to, from, next) {
|
|
|
|
+ next(vm => {
|
|
|
|
+ vm.previousUrl = from.path;
|
|
|
|
+ console.log("from.path:", from.path);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ beforeMount() {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ if (this.previousUrl.startsWith("/login/")) {
|
|
|
|
+ this.$Modal.info({
|
|
|
|
+ title: "欢迎",
|
|
|
|
+ render: () => (
|
|
|
|
+ <div>
|
|
|
|
+ <div style="font-weight:bold">
|
|
|
|
+ {this.$store.state.user.name} -{" "}
|
|
|
|
+ {this.$store.state.user.studentCode}
|
|
|
|
+ </div>
|
|
|
|
+ <div style="font-weight:bold">
|
|
|
|
+ 专业:{this.$store.state.user.specialty}{" "}
|
|
|
|
+ </div>
|
|
|
|
+ <div style="margin-top: 1.5em">
|
|
|
|
+ 欢迎使用考试系统,祝顺利完成考试!
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
async mounted() {
|
|
async mounted() {
|
|
window._hmt.push(["_trackEvent", "在线考试列表页面", "进入页面"]);
|
|
window._hmt.push(["_trackEvent", "在线考试列表页面", "进入页面"]);
|
|
const res = await this.$http.get(
|
|
const res = await this.$http.get(
|