Fix the site init issue (#53)
This commit is contained in:
1 parent
5f93958ddf
commit
76c0477cb1
3 files changed
+23
-3
No files matched your search
@@ -28,6 +28,7 @@ import { ElDialog } from 'element-plus';
|
||||
import { getBaseUrlAuth } from '@/utils';
|
||||
import { getCookie } from 'typescript-cookie';
|
||||
import QrCode from 'vue-qrcode';
|
||||
import { ROUTE_SITE_INDEX } from '@/router';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'AuthPanel',
|
||||
@@ -76,6 +77,14 @@ export default defineComponent({
|
||||
};
|
||||
await this.$store.dispatch('setToken', token);
|
||||
await this.$store.dispatch('getUser');
|
||||
// if the site is not initialized, initialize it
|
||||
if (this.$store.state.site?.origin) {
|
||||
await this.$store.dispatch('initializeSite');
|
||||
// after initialization, navigate to the site config page
|
||||
await this.$router.push({
|
||||
name: ROUTE_SITE_INDEX
|
||||
});
|
||||
}
|
||||
window.location.reload();
|
||||
}
|
||||
if (event.data.name === 'show_qr') {
|
||||
|
||||
Reference in new issue
Block a user