diff --git a/src/components/Footer/data.ts b/src/components/Footer/data.ts index b5cd93e..07b8d1a 100644 --- a/src/components/Footer/data.ts +++ b/src/components/Footer/data.ts @@ -16,10 +16,10 @@ interface DownLoadItemWithQRCode extends DownLoadItem { qrCode: string; } -interface DownLoadItemWithLink extends DownLoadItem { - type: 'link'; - downloadUrl: string; -} +// interface DownLoadItemWithLink extends DownLoadItem { +// type: 'link'; +// downloadUrl: string; +// } export const agreementList = [ { @@ -95,7 +95,8 @@ export const socialList: { name: string; url: string; target?: '_blank' | '_self ], ]; -export const downloadList: Array = [ +// export const downloadList: Array = [ +export const downloadList: Array = [ { type: 'QRCode', name: 'iOS版', @@ -114,12 +115,12 @@ export const downloadList: Array buttonText: '下载安装包至本地', qrCode: '/img/download/qrcode_ios.svg', }, - { - type: 'link', - name: 'Mac版', - downloadUrl: '#', - iconUrl: '/img/download/footer_mac.svg', - }, + // { + // type: 'link', + // name: 'Mac版', + // downloadUrl: '#', + // iconUrl: '/img/download/footer_mac.svg', + // }, { type: 'QRCode', name: 'Pad版', diff --git a/src/components/Journal/JournalCard.tsx b/src/components/Journal/JournalCard.tsx index 9c47a59..1b376f8 100644 --- a/src/components/Journal/JournalCard.tsx +++ b/src/components/Journal/JournalCard.tsx @@ -1,7 +1,6 @@ import Image from 'next/image'; import styles from './index.module.css'; -import { Children } from 'react'; function VolNo({ text }: { text: string }) { return ( diff --git a/src/components/Journal/JournalDetail/VolDetailCoverCard.tsx b/src/components/Journal/JournalDetail/VolDetailCoverCard.tsx index 6fdcd59..58f5527 100644 --- a/src/components/Journal/JournalDetail/VolDetailCoverCard.tsx +++ b/src/components/Journal/JournalDetail/VolDetailCoverCard.tsx @@ -10,7 +10,7 @@ export default function CoverCard({ journalInfo }: { journalInfo: JournalInfo }) {/* 播放/暂停 */} - + ); } diff --git a/src/components/Journal/VolPlayButton.tsx b/src/components/Journal/VolPlayButton.tsx index 95993ed..a7956ac 100644 --- a/src/components/Journal/VolPlayButton.tsx +++ b/src/components/Journal/VolPlayButton.tsx @@ -5,7 +5,7 @@ import { useShallow } from 'zustand/react/shallow'; import { PlayerButton } from '@/components'; import useAudioStore from '@/store/audio'; -export default function VolPlayButton({ no, className }: { no: string; className: string }) { +export default function VolPlayButton({ className }: { className: string }) { const { playState, setPlayState } = useAudioStore( useShallow((state) => { return { diff --git a/src/components/Login/LoginForm.tsx b/src/components/Login/LoginForm.tsx index 9ef2845..ba6fa85 100644 --- a/src/components/Login/LoginForm.tsx +++ b/src/components/Login/LoginForm.tsx @@ -7,18 +7,17 @@ import { useRouter } from 'next/navigation'; import { useShallow } from 'zustand/react/shallow'; import { useLoginRedirect } from '@/utils/login'; -import { setAccessToken } from '@/lib/cache'; import { Button } from '@/components'; -import { apiSendSMS, apiUserLogin, getUserInfo } from '@/services'; +import { setAccessToken } from '@/lib/cache'; +import { apiSendSMS, apiUserLogin } from '@/services'; import useUserStore from '@/store/user'; export default function LoginForm() { const redirect = useLoginRedirect(); const router = useRouter(); - const { userLogin, setShowLogin, getUserInfo } = useUserStore( + const { setShowLogin, getUserInfo } = useUserStore( useShallow((state) => ({ - userLogin: state.userLogin, setShowLogin: state.setShowLogin, getUserInfo: state.getUserInfo, })), diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 7eaaf16..7d2be38 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -1,3 +1,5 @@ +// @ts-nocheck + import * as React from 'react'; import { Slot } from '@radix-ui/react-slot'; import { cva, type VariantProps } from 'class-variance-authority'; diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index 3c81d4a..d27e45b 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -1,16 +1,16 @@ -import * as React from "react" -import * as DialogPrimitive from "@radix-ui/react-dialog" -import { X } from "lucide-react" +import * as React from 'react'; +import * as DialogPrimitive from '@radix-ui/react-dialog'; +import { X } from 'lucide-react'; -import { cn } from "/src/lib/utils" +import { cn } from '@/lib/utils'; -const Dialog = DialogPrimitive.Root +const Dialog = DialogPrimitive.Root; -const DialogTrigger = DialogPrimitive.Trigger +const DialogTrigger = DialogPrimitive.Trigger; -const DialogPortal = DialogPrimitive.Portal +const DialogPortal = DialogPrimitive.Portal; -const DialogClose = DialogPrimitive.Close +const DialogClose = DialogPrimitive.Close; const DialogOverlay = React.forwardRef< React.ElementRef, @@ -19,13 +19,13 @@ const DialogOverlay = React.forwardRef< -)) -DialogOverlay.displayName = DialogPrimitive.Overlay.displayName +)); +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< React.ElementRef, @@ -36,8 +36,8 @@ const DialogContent = React.forwardRef< @@ -48,36 +48,18 @@ const DialogContent = React.forwardRef< -)) -DialogContent.displayName = DialogPrimitive.Content.displayName +)); +DialogContent.displayName = DialogPrimitive.Content.displayName; -const DialogHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-) -DialogHeader.displayName = "DialogHeader" +const DialogHeader = ({ className, ...props }: React.HTMLAttributes) => ( +
+); +DialogHeader.displayName = 'DialogHeader'; -const DialogFooter = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-) -DialogFooter.displayName = "DialogFooter" +const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => ( +
+); +DialogFooter.displayName = 'DialogFooter'; const DialogTitle = React.forwardRef< React.ElementRef, @@ -85,26 +67,19 @@ const DialogTitle = React.forwardRef< >(({ className, ...props }, ref) => ( -)) -DialogTitle.displayName = DialogPrimitive.Title.displayName +)); +DialogTitle.displayName = DialogPrimitive.Title.displayName; const DialogDescription = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -DialogDescription.displayName = DialogPrimitive.Description.displayName + +)); +DialogDescription.displayName = DialogPrimitive.Description.displayName; export { Dialog, @@ -117,4 +92,4 @@ export { DialogFooter, DialogTitle, DialogDescription, -} +}; diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx index 4e8f7af..325d7b7 100644 --- a/src/components/ui/popover.tsx +++ b/src/components/ui/popover.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as PopoverPrimitive from '@radix-ui/react-popover'; -import { cn } from '/src/lib/utils'; +import { cn } from '@/lib/utils'; const Popover = PopoverPrimitive.Root; diff --git a/src/components/ui/toaster.tsx b/src/components/ui/toaster.tsx index 29e1307..13ce23b 100644 --- a/src/components/ui/toaster.tsx +++ b/src/components/ui/toaster.tsx @@ -1,15 +1,8 @@ -import { - Toast, - ToastClose, - ToastDescription, - ToastProvider, - ToastTitle, - ToastViewport, -} from "/src/components/ui/toast" -import { useToast } from "/src/components/ui/use-toast" +import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '@/components/ui/toast'; +import { useToast } from '@/components/ui/use-toast'; export function Toaster() { - const { toasts } = useToast() + const { toasts } = useToast(); return ( @@ -18,16 +11,14 @@ export function Toaster() {
{title && {title}} - {description && ( - {description} - )} + {description && {description}}
{action}
- ) + ); })}
- ) + ); } diff --git a/src/store/user.ts b/src/store/user.ts index ceedb5f..6df722f 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -1,15 +1,15 @@ import { produce } from 'immer'; -import { setCookie, parseCookies, destroyCookie } from 'nookies'; +// import { setCookie } from 'nookies'; import { create } from 'zustand'; import { devtools, persist, createJSONStorage } from 'zustand/middleware'; -import { apiGetMyUserInfo, apiUserLogin, apiUserLogout } from '@/services'; +import { apiGetMyUserInfo } from '@/services'; -interface TRequestLogin { - mobile: string; - mobileCheckCode: string; - deviceId: string; -} +// interface TRequestLogin { +// mobile: string; +// mobileCheckCode: string; +// deviceId: string; +// } interface UserState { /** 登录框显示状态 */ @@ -21,7 +21,7 @@ interface UserState { /** 更新用户信息 */ setUserInfo: (parmas: UserInfo) => void; /** 用户登录 */ - userLogin: (params: TRequestLogin) => Promise>; + // userLogin: (params: TRequestLogin) => Promise>; /** 获取用户信息 */ getUserInfo: () => Promise>; } @@ -74,32 +74,32 @@ const useUserStore = create()( }), ), setUserInfo, - userLogin: async (params) => { - const result = { code: 200, data: '1', message: '登录成功' }; - if (result.code === 200) { - setCookie( - null, - 'token', - 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxNzc5MDMxOTU1MzUwODg0MzUyIiwic3ViIjoi6ZuA5LmQLVQ5WkhteGkxVSIsImlhdCI6MTcxMzMzNTY1MCwiYXZhdGFyIjoidXNlci9hdmF0YXIvZGVmYXVsdC5wbmciLCJyb2xlcyI6InVzZXIiLCJleHAiOjE3MTM5NDA0NTB9.YtNph3J4XPyADfFAgCpUvh5VE4RgSRC0FH1ZDcNtPhU', - { - maxAge: 7 * 24 * 60 * 60, - path: '/', - }, - ); - await getUserInfo(); - } + // userLogin: async (params) => { + // const result = { code: 200, data: '1', message: '登录成功' }; + // if (result.code === 200) { + // setCookie( + // null, + // 'token', + // 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxNzc5MDMxOTU1MzUwODg0MzUyIiwic3ViIjoi6ZuA5LmQLVQ5WkhteGkxVSIsImlhdCI6MTcxMzMzNTY1MCwiYXZhdGFyIjoidXNlci9hdmF0YXIvZGVmYXVsdC5wbmciLCJyb2xlcyI6InVzZXIiLCJleHAiOjE3MTM5NDA0NTB9.YtNph3J4XPyADfFAgCpUvh5VE4RgSRC0FH1ZDcNtPhU', + // { + // maxAge: 7 * 24 * 60 * 60, + // path: '/', + // }, + // ); + // await getUserInfo(); + // } - return result; - // const result = await apiUserLogin(params); - // if (result.code === 200) { - // setCookie(null, 'token', result.data, { - // maxAge: 7 * 24 * 60 * 60, - // path: '/', - // }); - // await getUserInfo(); - // } - // return result; - }, + // return result; + // // const result = await apiUserLogin(params); + // // if (result.code === 200) { + // // setCookie(null, 'token', result.data, { + // // maxAge: 7 * 24 * 60 * 60, + // // path: '/', + // // }); + // // await getUserInfo(); + // // } + // // return result; + // }, getUserInfo, }; },