fix(show): delete show
This commit is contained in:
@@ -6,7 +6,7 @@ import { useEffect } from "react"
|
|||||||
export default function Home() {
|
export default function Home() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
router.push("/show")
|
router.push("/management")
|
||||||
}, [router])
|
}, [router])
|
||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import AppLayout from "@/components/layout/AppLayout"
|
|
||||||
import { PathnameRecorder } from "@/components/layout/PathnameRecorder"
|
|
||||||
import { componentList, showList } from "@/components/layout/common"
|
|
||||||
|
|
||||||
async function getMenu() {
|
|
||||||
return [...componentList, ...showList]
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function Layout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode
|
|
||||||
}) {
|
|
||||||
const menu = await getMenu()
|
|
||||||
return (
|
|
||||||
<AppLayout menu={menu}>
|
|
||||||
{children}
|
|
||||||
<PathnameRecorder menu={menu} />
|
|
||||||
</AppLayout>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { useRouter } from "next/navigation"
|
|
||||||
import { useEffect } from "react"
|
|
||||||
|
|
||||||
export default function ComponentPage() {
|
|
||||||
const router = useRouter()
|
|
||||||
useEffect(() => {
|
|
||||||
router.push("/show/user")
|
|
||||||
}, [router])
|
|
||||||
return <></>
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
export default function ShowUserPage() {
|
|
||||||
return <>ShowUserPage</>
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@ import { Login } from "./types"
|
|||||||
// 获取验证码
|
// 获取验证码
|
||||||
export const getVerifyCode = (params: { phone: string }) => {
|
export const getVerifyCode = (params: { phone: string }) => {
|
||||||
return httpFetch<ResultData<{}>>({
|
return httpFetch<ResultData<{}>>({
|
||||||
url: `/api/v1/front/login/get_verify_code`,
|
url: `/api/v1/basis/login/get_verify_code`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
})
|
})
|
||||||
@@ -14,7 +14,7 @@ export const getVerifyCode = (params: { phone: string }) => {
|
|||||||
// 账户登录
|
// 账户登录
|
||||||
export const passwdLogin = (params: Login.ReqPasswdLogin) => {
|
export const passwdLogin = (params: Login.ReqPasswdLogin) => {
|
||||||
return httpFetch<ResultData<Login.ResLogin>>({
|
return httpFetch<ResultData<Login.ResLogin>>({
|
||||||
url: `/api/v1/front/login/passwd`,
|
url: `/api/v1/basis/login/passwd`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
isLogin: true,
|
isLogin: true,
|
||||||
@@ -24,7 +24,7 @@ export const passwdLogin = (params: Login.ReqPasswdLogin) => {
|
|||||||
// 验证码登录
|
// 验证码登录
|
||||||
export const verificationLogin = (params: Login.ReqVerificationLogin) => {
|
export const verificationLogin = (params: Login.ReqVerificationLogin) => {
|
||||||
return httpFetch<ResultData<Login.ResLogin>>({
|
return httpFetch<ResultData<Login.ResLogin>>({
|
||||||
url: `/api/v1/front/login/verification`,
|
url: `/api/v1/basis/login/verification`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
isLogin: true,
|
isLogin: true,
|
||||||
@@ -34,7 +34,7 @@ export const verificationLogin = (params: Login.ReqVerificationLogin) => {
|
|||||||
// 飞书登录
|
// 飞书登录
|
||||||
export const fetchFeishuLogin = (params: Login.ReqFeishuLogin) => {
|
export const fetchFeishuLogin = (params: Login.ReqFeishuLogin) => {
|
||||||
return httpFetch<ResultData<Login.ResLogin>>({
|
return httpFetch<ResultData<Login.ResLogin>>({
|
||||||
url: `/api/v1/front/login/feishu`,
|
url: `/api/v1/basis/login/feishu`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
isLogin: true,
|
isLogin: true,
|
||||||
@@ -44,7 +44,7 @@ export const fetchFeishuLogin = (params: Login.ReqFeishuLogin) => {
|
|||||||
// 刷新token
|
// 刷新token
|
||||||
export const refreshKey = (params: { token: string }) => {
|
export const refreshKey = (params: { token: string }) => {
|
||||||
return httpFetch<ResultData<Login.ResRefreshKey>>({
|
return httpFetch<ResultData<Login.ResRefreshKey>>({
|
||||||
url: `/api/v1/front/key/refresh`,
|
url: `/api/v1/basis/key/refresh`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
isRefresh: true,
|
isRefresh: true,
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useCallback, useEffect, useMemo, useState } from "react"
|
|
||||||
import {
|
|
||||||
Box,
|
|
||||||
TextInput,
|
|
||||||
PasswordInput,
|
|
||||||
Paper,
|
|
||||||
Text,
|
|
||||||
Group,
|
|
||||||
Button,
|
|
||||||
LoadingOverlay,
|
|
||||||
Stack,
|
|
||||||
Modal,
|
|
||||||
Flex,
|
|
||||||
BackgroundImage,
|
|
||||||
Tabs,
|
|
||||||
FloatingIndicator,
|
|
||||||
Input,
|
|
||||||
useComputedColorScheme,
|
|
||||||
} from "@mantine/core"
|
|
||||||
import { useForm } from "@mantine/form"
|
|
||||||
import { useDisclosure } from "@mantine/hooks"
|
|
||||||
import { DigitalIcon } from "./resource/icons/digital"
|
|
||||||
import tabClasses from "./Tab.module.css"
|
|
||||||
import {
|
import {
|
||||||
getQueryVariable,
|
getQueryVariable,
|
||||||
validatePhoneNumber,
|
validatePhoneNumber,
|
||||||
} from "@/components/login/libs/common"
|
} from "@/components/login/libs/common"
|
||||||
|
import FingerprintJS from "@fingerprintjs/fingerprintjs"
|
||||||
|
import {
|
||||||
|
BackgroundImage,
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Flex,
|
||||||
|
FloatingIndicator,
|
||||||
|
Group,
|
||||||
|
Input,
|
||||||
|
LoadingOverlay,
|
||||||
|
Modal,
|
||||||
|
Paper,
|
||||||
|
PasswordInput,
|
||||||
|
Stack,
|
||||||
|
Tabs,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
useComputedColorScheme,
|
||||||
|
} from "@mantine/core"
|
||||||
|
import { useForm } from "@mantine/form"
|
||||||
|
import { useDisclosure } from "@mantine/hooks"
|
||||||
|
import { useCallback, useEffect, useMemo, useState } from "react"
|
||||||
import { getVerifyCode, passwdLogin, verificationLogin } from "./api"
|
import { getVerifyCode, passwdLogin, verificationLogin } from "./api"
|
||||||
import QrLogin from "./feishu/qr-login"
|
import QrLogin from "./feishu/qr-login"
|
||||||
import { APP, PLATFORM, TENANT } from "./libs/common"
|
import { APP, PLATFORM, TENANT } from "./libs/common"
|
||||||
import FingerprintJS from "@fingerprintjs/fingerprintjs"
|
import { DigitalIcon } from "./resource/icons/digital"
|
||||||
import { useLoginStore } from "./store"
|
import { useLoginStore } from "./store"
|
||||||
|
import tabClasses from "./Tab.module.css"
|
||||||
// import { useSearchParams } from "next/navigation"
|
// import { useSearchParams } from "next/navigation"
|
||||||
import Feishu from "./feishu/auto-login"
|
import Feishu from "./feishu/auto-login"
|
||||||
import LightBgImage from "./resource/images/light-login-bg.png"
|
|
||||||
import DarkBgImage from "./resource/images/dark-login-bg.png"
|
import DarkBgImage from "./resource/images/dark-login-bg.png"
|
||||||
import LogoDigImage from "./resource/images/logo-dig.png"
|
import LightBgImage from "./resource/images/light-login-bg.png"
|
||||||
import loginBg2Light from "./resource/images/login-bg2-light.png"
|
|
||||||
import loginBg2Dark from "./resource/images/login-bg2-dark.png"
|
import loginBg2Dark from "./resource/images/login-bg2-dark.png"
|
||||||
|
import loginBg2Light from "./resource/images/login-bg2-light.png"
|
||||||
|
import LogoDigImage from "./resource/images/logo-dig.png"
|
||||||
|
|
||||||
const HeaderIcon = DigitalIcon
|
const HeaderIcon = DigitalIcon
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ export default async function middleware(req: NextRequest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 5. Redirect to /dashboard if the user is authenticated
|
// 5. Redirect to /dashboard if the user is authenticated
|
||||||
if (isPublicRoute && session && !path.startsWith("/show")) {
|
if (isPublicRoute && session && !path.startsWith("/management")) {
|
||||||
return NextResponse.redirect(
|
return NextResponse.redirect(
|
||||||
new URL(`${process.env.NEXT_PUBLIC_BASE_PATH}/show`, req.nextUrl)
|
new URL(`${process.env.NEXT_PUBLIC_BASE_PATH}/management`, req.nextUrl)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone next dev --turbopack -p 5521",
|
"dev": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone next dev --turbopack -p 5521",
|
||||||
"dev:export": "NEXT_PUBLIC_URL=https://frontside.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=export next dev --turbopack -p 5521",
|
"dev:export": "NEXT_PUBLIC_URL=https://basis.softtest.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=export next dev --turbopack -p 5521",
|
||||||
"dev:standalone": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone next dev next dev --turbopack -p 5521",
|
"dev:standalone": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone next dev next dev --turbopack -p 5521",
|
||||||
"build:standalone-stage": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone env-cmd -f .env.staging next build --turbopack",
|
"build:standalone-stage": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone env-cmd -f .env.staging next build --turbopack",
|
||||||
"prebuild:export-stage": "node scripts/disable-api-route.mjs",
|
"prebuild:export-stage": "node scripts/disable-api-route.mjs",
|
||||||
"build:export-stage": "NEXT_PUBLIC_URL=https://frontside.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=export env-cmd -f .env.staging next build --turbopack",
|
"build:export-stage": "NEXT_PUBLIC_URL=https://basis.softtest.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=export env-cmd -f .env.staging next build --turbopack",
|
||||||
"postbuild:export-stage": "node scripts/restore-api-route.mjs",
|
"postbuild:export-stage": "node scripts/restore-api-route.mjs",
|
||||||
"build:standalone-prod": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone env-cmd -f .env.production next build --turbopack",
|
"build:standalone-prod": "NEXT_PUBLIC_URL=https://frontside2.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=standalone env-cmd -f .env.production next build --turbopack",
|
||||||
"prebuild:export-prod": "node scripts/disable-api-route.mjs",
|
"prebuild:export-prod": "node scripts/disable-api-route.mjs",
|
||||||
"build:export-prod": "NEXT_PUBLIC_URL=https://frontside.soft.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=export env-cmd -f .env.production next build --turbopack",
|
"build:export-prod": "NEXT_PUBLIC_URL=https://basis.softtest.cowarobot.com NEXT_PUBLIC_OUTPUT_TYPE=export env-cmd -f .env.production next build --turbopack",
|
||||||
"postbuild:export-prod": "node scripts/restore-api-route.mjs",
|
"postbuild:export-prod": "node scripts/restore-api-route.mjs",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
|
|||||||
Reference in New Issue
Block a user