|
@@ -49,6 +49,7 @@
|
|
|
|
|
|
<script>
|
|
|
import moment from "moment";
|
|
|
+import { mapMutations } from "vuex";
|
|
|
/**
|
|
|
* 在任何组件需要强制退出,做以下步骤
|
|
|
* 1. this.$Message.info()
|
|
@@ -98,6 +99,7 @@ export default {
|
|
|
window.localStorage.removeItem("key");
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapMutations(["updateUser"]),
|
|
|
async login(name) {
|
|
|
const valid = await this.$refs[name].validate();
|
|
|
if (valid) {
|
|
@@ -129,7 +131,7 @@ export default {
|
|
|
const student = (await this.$http.get(
|
|
|
"/api/ecs_core/student/getStudentInfoBySession"
|
|
|
)).data;
|
|
|
- this.$store.state.user = { ...data, ...student };
|
|
|
+ this.updateUser({ ...data, ...student });
|
|
|
this.$router.push("/online-exam");
|
|
|
} else {
|
|
|
this.errorInfo = data.desc;
|