|
@@ -160,6 +160,7 @@
|
160
|
160
|
<script>
|
161
|
161
|
import { admin_detail, admin_edit_phone, admin_edit_pwd } from "@/api/admin";
|
162
|
162
|
import { login_msg_code } from "@/api/login";
|
|
163
|
+import { login_check_login, login_login_out } from "@/api/school";
|
163
|
164
|
import { logdoperatemsg_get_nrn } from "@/api/log";
|
164
|
165
|
import { pwdCheck, reg } from "@/utils";
|
165
|
166
|
export default {
|
|
@@ -218,6 +219,7 @@ export default {
|
218
|
219
|
}
|
219
|
220
|
]
|
220
|
221
|
},
|
|
222
|
+ time1: null,
|
221
|
223
|
userInfo: {}
|
222
|
224
|
};
|
223
|
225
|
},
|
|
@@ -236,6 +238,7 @@ export default {
|
236
|
238
|
this.userInfo = JSON.parse(
|
237
|
239
|
localStorage.getItem("xh_control_userInfo")
|
238
|
240
|
).content;
|
|
241
|
+ this.get_check_user();
|
239
|
242
|
},
|
240
|
243
|
computed: {
|
241
|
244
|
// 所属名称
|
|
@@ -251,8 +254,33 @@ export default {
|
251
|
254
|
this.$EventBus.$on("nreadChange", () => {
|
252
|
255
|
this.nreadNum = this.nreadNum > 0 ? this.nreadNum - 1 : 0;
|
253
|
256
|
});
|
|
257
|
+ this.time1 = setInterval(() => {
|
|
258
|
+ this.get_check_user();
|
|
259
|
+ }, 1000 * 60);
|
|
260
|
+ },
|
|
261
|
+ beforeDestroy() {
|
|
262
|
+ if (this.time1) {
|
|
263
|
+ clearInterval(this.time1);
|
|
264
|
+ }
|
254
|
265
|
},
|
255
|
266
|
methods: {
|
|
267
|
+ //判断用户是否需要重新登录
|
|
268
|
+ get_check_user() {
|
|
269
|
+ let adminid = this.userInfo.adminid;
|
|
270
|
+ let loginpwd = this.userInfo.loginpwd;
|
|
271
|
+ login_check_login({ adminid, loginpwd }).then((res) => {
|
|
272
|
+ if (res.code === 0) {
|
|
273
|
+ if (res.obj) {
|
|
274
|
+ let needLogin = res.obj.needLogin;
|
|
275
|
+ if (needLogin) {
|
|
276
|
+ this.toLoginOut();
|
|
277
|
+ }
|
|
278
|
+ }
|
|
279
|
+ } else {
|
|
280
|
+ this.toLoginOut();
|
|
281
|
+ }
|
|
282
|
+ });
|
|
283
|
+ },
|
256
|
284
|
init() {
|
257
|
285
|
logdoperatemsg_get_nrn({
|
258
|
286
|
rtype: this.powerParams.rtype,
|
|
@@ -382,7 +410,6 @@ export default {
|
382
|
410
|
phone: "",
|
383
|
411
|
msgcode: ""
|
384
|
412
|
};
|
385
|
|
-
|
386
|
413
|
}
|
387
|
414
|
} else {
|
388
|
415
|
this.$Message.error(res.msg);
|
|
@@ -402,7 +429,11 @@ export default {
|
402
|
429
|
},
|
403
|
430
|
// 退出
|
404
|
431
|
toLoginOut() {
|
405
|
|
- this.$router.push("/login");
|
|
432
|
+ login_login_out({ adminid: this.userInfo.adminid }).then((res) => {
|
|
433
|
+ this.$router.replace({
|
|
434
|
+ path: "/login"
|
|
435
|
+ });
|
|
436
|
+ });
|
406
|
437
|
}
|
407
|
438
|
}
|
408
|
439
|
};
|