修复登录后无法进入主界面,需要刷新的BUG

This commit is contained in:
fangxiang 2022-07-06 15:42:08 +08:00
parent 37baa6d678
commit 18a3884e15
2 changed files with 26 additions and 0 deletions

View File

@ -255,6 +255,7 @@ import { useRouter } from "vue-router";
import EventBus, { EventNamesDefine } from "src/common/EventBus"; import EventBus, { EventNamesDefine } from "src/common/EventBus";
import { useStore } from "src/store"; import { useStore } from "src/store";
import { Md5 } from "ts-md5/dist/md5"; import { Md5 } from "ts-md5/dist/md5";
import Initializer from "src/common/Initializer";
class _Data { class _Data {
user_name: string | null = null; user_name: string | null = null;
@ -475,6 +476,18 @@ export default defineComponent({
$store.commit("setDeviceIpAddress", data.ip_address); $store.commit("setDeviceIpAddress", data.ip_address);
setTimeout(() => {
new Initializer({
$t,
$store,
$q,
})
.initialize()
.then(() => {
$store.commit("setInitialized");
});
}, 0);
$route.push("/"); $route.push("/");
} else { } else {
$q.notify({ $q.notify({

View File

@ -202,6 +202,7 @@ import { useRouter } from "vue-router";
import EventBus, { EventNamesDefine } from "src/common/EventBus"; import EventBus, { EventNamesDefine } from "src/common/EventBus";
import { useStore } from "src/store"; import { useStore } from "src/store";
import { Md5 } from "ts-md5/dist/md5"; import { Md5 } from "ts-md5/dist/md5";
import Initializer from "src/common/Initializer";
class _Data { class _Data {
user_name: string | null = null; user_name: string | null = null;
@ -400,6 +401,18 @@ export default defineComponent({
$store.commit("setDeviceIpAddress", data.ip_address); $store.commit("setDeviceIpAddress", data.ip_address);
setTimeout(() => {
new Initializer({
$t,
$store,
$q,
})
.initialize()
.then(() => {
$store.commit("setInitialized");
});
}, 0);
$route.push("/"); $route.push("/");
} else { } else {
$q.notify({ $q.notify({