refactor(chat + workspace): chat和workspace重构,子路由、懒加载等
This commit is contained in:
1 parent
0a647a0b79
commit
1f1f7236b0
57 files changed
+4356
-3798
No files matched your search
@@ -7,11 +7,9 @@ import LevelMessageDialog from './components/LevelMessageDialog.vue';
|
||||
import { useGlobalMessageDialog } from './composables/useGlobalMessageDialog';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { getAuthHeaders, logoutAuth } from './utils/auth';
|
||||
import { isPublicPath } from '@/shared/constants/routes';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const PUBLIC_PATHS = ['/', '/workspace', '/casdoor-callback', '/reset-password'];
|
||||
|
||||
const { locale } = useI18n();
|
||||
const { themePreference, initTheme, setThemePreference } = useTheme();
|
||||
const {
|
||||
@@ -72,8 +70,8 @@ const onLogout = (event: Event) => {
|
||||
showMessageDialog('info', '您已在其他标签页退出登录');
|
||||
}
|
||||
const path = router.currentRoute.value.path;
|
||||
if (!PUBLIC_PATHS.includes(path)) {
|
||||
router.push('/workspace');
|
||||
if (!isPublicPath(path)) {
|
||||
router.push('/login');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user