75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
import { createRouter, createWebHistory } from 'vue-router';
|
|
import auth from './auth';
|
|
import console from './console';
|
|
import grok from './grok';
|
|
import gemini from './gemini';
|
|
import claude from './claude';
|
|
import deepseek from './deepseek';
|
|
import chatgpt from './chatgpt';
|
|
import midjourney from './midjourney';
|
|
import distribution from './distribution';
|
|
import qrart from './qrart';
|
|
import luma from './luma';
|
|
import pika from './pika';
|
|
import kling from './kling';
|
|
import veo from './veo';
|
|
import sora from './sora';
|
|
import pixverse from './pixverse';
|
|
import flux from './flux';
|
|
import hailuo from './hailuo';
|
|
import headshots from './headshots';
|
|
import suno from './suno';
|
|
import nanobanana from './nanobanana';
|
|
import site from './site';
|
|
import profile from './profile';
|
|
|
|
import { ROUTE_CHATGPT_CONVERSATION_NEW } from './constants';
|
|
import { getCookie } from 'typescript-cookie';
|
|
import { I18N_DEFAULT_LOCALE } from '@/constants/i18n';
|
|
import { getLocale, setI18nLanguage } from '@/i18n';
|
|
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
redirect: { name: ROUTE_CHATGPT_CONVERSATION_NEW }
|
|
},
|
|
console,
|
|
auth,
|
|
chatgpt,
|
|
grok,
|
|
gemini,
|
|
claude,
|
|
deepseek,
|
|
qrart,
|
|
luma,
|
|
pika,
|
|
kling,
|
|
veo,
|
|
sora,
|
|
pixverse,
|
|
flux,
|
|
hailuo,
|
|
headshots,
|
|
suno,
|
|
nanobanana,
|
|
midjourney,
|
|
distribution,
|
|
site,
|
|
profile
|
|
];
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes
|
|
});
|
|
|
|
router.beforeEach(async (_to, _from, next) => {
|
|
const locale = getLocale(getCookie('LOCALE') || I18N_DEFAULT_LOCALE);
|
|
await setI18nLanguage(locale);
|
|
return next();
|
|
});
|
|
|
|
export default router;
|
|
|
|
export * from './constants';
|