First merge from develop to main (WIP) #7

Merged
sugar merged 199 commits from develop into main 2026-01-27 17:47:07 +00:00
6 changed files with 7947 additions and 1822 deletions
Showing only changes of commit 7edcda544b - Show all commits

File diff suppressed because it is too large Load Diff

7943
client/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,32 +0,0 @@
import { Badge } from '@/components/ui/badge';
import { Card, CardAction, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
import { useUserInfo } from '@/hooks/data/useUserInfo';
import { QrDialog } from '../checkin/qr-dialog';
import { withFallback } from '../hoc/with-fallback';
import { CardSkeleton } from './card-skeleton';
function CheckinCard_() {
const { data } = useUserInfo();
return (
<Card className="@container/card">
<CardHeader>
<CardDescription></CardDescription>
<CardTitle className="text-2xl font-semibold tabular-nums @[250px]/card:text-3xl">
{data.checkin !== null ? '已签到' : '未签到'}
{data.checkin !== null && <span className="text-sm font-medium ml-2">{`${new Date(data.checkin).toLocaleString()}`}</span>}
</CardTitle>
<CardAction>
<Badge variant="outline">Day 1</Badge>
</CardAction>
</CardHeader>
<CardFooter className="flex-col items-start gap-1.5 text-sm">
<QrDialog
eventId="019b5bf2-90ce-75f5-93a4-a66914c2ef11"
>
</QrDialog>
</CardFooter>
</Card>
);
}
export const CheckinCard = withFallback(CheckinCard_, <CardSkeleton />);

View File

@@ -36,7 +36,7 @@ axiosClient.interceptors.response.use(undefined, async (error: AxiosError) => {
} }
catch (e) { catch (e) {
if (e instanceof AxiosError && e.status === 401) { if (e instanceof AxiosError && e.status === 401) {
await router.navigate({ to: '/login' }); await router.navigate({ to: '/authorize' });
return Promise.reject(error); return Promise.reject(error);
} }
} }

View File

@@ -47,11 +47,11 @@ const SidebarLayoutProfileRoute = SidebarLayoutProfileRouteImport.update({
} as any) } as any)
export interface FileRoutesByFullPath { export interface FileRoutesByFullPath {
'/': typeof SidebarLayoutIndexRoute
'/authorize': typeof AuthorizeRoute '/authorize': typeof AuthorizeRoute
'/magicLinkSent': typeof MagicLinkSentRoute '/magicLinkSent': typeof MagicLinkSentRoute
'/token': typeof TokenRoute '/token': typeof TokenRoute
'/profile': typeof SidebarLayoutProfileRoute '/profile': typeof SidebarLayoutProfileRoute
'/': typeof SidebarLayoutIndexRoute
} }
export interface FileRoutesByTo { export interface FileRoutesByTo {
'/authorize': typeof AuthorizeRoute '/authorize': typeof AuthorizeRoute
@@ -71,7 +71,7 @@ export interface FileRoutesById {
} }
export interface FileRouteTypes { export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/authorize' | '/magicLinkSent' | '/token' | '/profile' | '/' fullPaths: '/' | '/authorize' | '/magicLinkSent' | '/token' | '/profile'
fileRoutesByTo: FileRoutesByTo fileRoutesByTo: FileRoutesByTo
to: '/authorize' | '/magicLinkSent' | '/token' | '/profile' | '/' to: '/authorize' | '/magicLinkSent' | '/token' | '/profile' | '/'
id: id:
@@ -117,7 +117,7 @@ declare module '@tanstack/react-router' {
'/_sidebarLayout': { '/_sidebarLayout': {
id: '/_sidebarLayout' id: '/_sidebarLayout'
path: '' path: ''
fullPath: '' fullPath: '/'
preLoaderRoute: typeof SidebarLayoutRouteImport preLoaderRoute: typeof SidebarLayoutRouteImport
parentRoute: typeof rootRouteImport parentRoute: typeof rootRouteImport
} }

View File

@@ -1,5 +1,4 @@
import { createFileRoute, redirect } from '@tanstack/react-router'; import { createFileRoute, redirect } from '@tanstack/react-router';
import { CheckinCard } from '@/components/workbenchCards/checkin';
import { hasToken } from '@/lib/token'; import { hasToken } from '@/lib/token';
export const Route = createFileRoute('/_sidebarLayout/')({ export const Route = createFileRoute('/_sidebarLayout/')({
@@ -21,7 +20,6 @@ function Index() {
grid grid-cols-1 gap-4 px-4 auto-rows-[minmax(175px,auto)] items-stretch grid grid-cols-1 gap-4 px-4 auto-rows-[minmax(175px,auto)] items-stretch
*:data-[slot=card]:bg-linear-to-t *:data-[slot=card]:shadow-xs lg:px-6 @xl/main:grid-cols-2 @5xl/main:grid-cols-4" *:data-[slot=card]:bg-linear-to-t *:data-[slot=card]:shadow-xs lg:px-6 @xl/main:grid-cols-2 @5xl/main:grid-cols-4"
> >
<CheckinCard />
</div> </div>
</div> </div>
); );