Browse Source

ts 报错

main
chenyang 2 months ago
parent
commit
8dcdee52d8
  1. 15
      src/routes.tsx
  2. 4
      vite.config.ts

15
src/routes.tsx

@ -10,6 +10,7 @@ import EmptyLayout from '@/layout/EmptyLayout.tsx'
// import ListPageLayout from '@/layout/ListPageLayout.tsx' // import ListPageLayout from '@/layout/ListPageLayout.tsx'
// import { Route as DashboardImport } from '@/pages/dashboard' // import { Route as DashboardImport } from '@/pages/dashboard'
import { Route as LoginRouteImport } from '@/pages/login' import { Route as LoginRouteImport } from '@/pages/login'
import { Route as RegisterRouteImport } from '@/pages/login/register'
import { generateUUID } from '@/utils/uuid.ts' import { generateUUID } from '@/utils/uuid.ts'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import Login2 from '@/pages/login2/index.tsx' import Login2 from '@/pages/login2/index.tsx'
@ -31,6 +32,7 @@ import { IRootContext, MenuItem } from './global'
import { useAtomValue } from 'jotai' import { useAtomValue } from 'jotai'
import { userMenuDataAtom } from '@/store/system/user.ts' import { userMenuDataAtom } from '@/store/system/user.ts'
import { ApiContextProvider } from '@/context.ts' import { ApiContextProvider } from '@/context.ts'
import Register from "@/pages/login/register.tsx";
const PageRootLayout = () => { const PageRootLayout = () => {
return <PageStoreProvider> return <PageStoreProvider>
@ -109,6 +111,10 @@ const loginRoute = LoginRouteImport.update({
getParentRoute: () => emptyRoute, getParentRoute: () => emptyRoute,
} as any) } as any)
const registerRoute = RegisterRouteImport.update({
path: '/register',
getParentRoute: () => emptyRoute,
} as any)
// const login2Route = LoginRouteImport.update({ // const login2Route = LoginRouteImport.update({
// path: '/login2', // path: '/login2',
// getParentRoute: () => emptyRoute, // getParentRoute: () => emptyRoute,
@ -165,7 +171,7 @@ declare module '@tanstack/react-router' {
}, },
'/register': { '/register': {
preLoaderRoute: typeof layoutNormalRoute
preLoaderRoute: typeof RegisterRouteImport
parentRoute: typeof rootRoute parentRoute: typeof rootRoute
}, },
// '/system/menus': { // '/system/menus': {
@ -313,14 +319,9 @@ const routeTree = rootRoute.addChildren(
//非Layout //非Layout
loginRoute, loginRoute,
emptyRoute, emptyRoute,
registerRoute,
//login2Route, //login2Route,
// 添加新的自定义路由 // 添加新的自定义路由
createRoute({
getParentRoute: () => rootRoute,
path: '/login2',
component: Login2,
}),
//不带权限Layout //不带权限Layout

4
vite.config.ts

@ -8,8 +8,8 @@ import jotaiReactRefresh from "jotai/babel/plugin-react-refresh";
//import { TanStackRouterVite } from '@tanstack/router-vite-plugin' //import { TanStackRouterVite } from '@tanstack/router-vite-plugin'
export const downLoadUrl = "http://127.0.0.1:8000"; export const downLoadUrl = "http://127.0.0.1:8000";
const proxyMap = { const proxyMap = {
'/api/v1/mdw-msg': 'http://127.0.0.1:8848',
"/api/v1/package": "http://154.88.7.8:45321",
// '/api/v1/mdw-msg': 'http://127.0.0.1:8848',
// "/api/v1/package": "http://154.88.7.8:45321",
"/api/v1/movie": "http://47.113.117.106:10000", "/api/v1/movie": "http://47.113.117.106:10000",
//'/api/v1/certold': 'http://192.168.31.41:8000', //'/api/v1/certold': 'http://192.168.31.41:8000',
"/api/v1/cert": "http://127.0.0.1:8000", "/api/v1/cert": "http://127.0.0.1:8000",

Loading…
Cancel
Save