mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 15:46:39 +08:00
123
This commit is contained in:
parent
c6c78b7798
commit
8fedb17183
@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { auth, getIP } from "@/app/api/auth";
|
||||
import { auth } from "@/app/api/auth";
|
||||
import { ModelProvider } from "@/app/constant";
|
||||
import { requestLog } from "@/app/api/common";
|
||||
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
import { prettyObject } from "@/app/utils/format";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { auth } from "./auth";
|
||||
import { requestOpenai, requestLog } from "./common";
|
||||
import { requestOpenai } from "./common";
|
||||
|
||||
// const ALLOWED_PATH = new Set(Object.values({ ...OpenaiPath, ...AZURE_PATH }));
|
||||
const ALLOWD_PATH = new Set(Object.values(OpenaiPath));
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import React, { ReactNode, useEffect, useState } from "react";
|
||||
import { MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons";
|
||||
import { Layout, Menu, Button, theme, ConfigProvider, ThemeConfig } from "antd";
|
||||
import { Layout, Button, theme, ConfigProvider } from "antd";
|
||||
import SideBar from "../components/sidebar";
|
||||
|
||||
const { Header, Sider, Content } = Layout;
|
||||
|
@ -1,8 +1,6 @@
|
||||
"use client";
|
||||
import type { FormProps } from "antd";
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
Form,
|
||||
Input,
|
||||
Modal,
|
||||
|
@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useState } from "react";
|
||||
// import Link from "next/link";
|
||||
import { useRouter, usePathname } from "next/navigation";
|
||||
|
||||
|
@ -13,7 +13,7 @@ import {
|
||||
Modal,
|
||||
Form,
|
||||
} from "antd";
|
||||
import type { GetRef, TableColumnsType } from "antd";
|
||||
import type { TableColumnsType } from "antd";
|
||||
import { LockOutlined } from "@ant-design/icons";
|
||||
// import { headers } from 'next/headers'
|
||||
import type { NotificationArgsProps } from "antd";
|
||||
|
@ -1,7 +1,5 @@
|
||||
import Image from "next/image";
|
||||
import LoginByGithub from "./loginByGithub";
|
||||
import UserLoginCore from "./user-login-core";
|
||||
import { Suspense } from "react";
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
|
@ -1,18 +1,17 @@
|
||||
"use client";
|
||||
import { redirect } from "next/navigation";
|
||||
// import { getSession } from "@/lib/auth";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { Button, Checkbox, Form, FormProps, Input } from "antd";
|
||||
import { Form, FormProps, Input } from "antd";
|
||||
import { LockOutlined } from "@ant-design/icons";
|
||||
import React, { useState } from "react";
|
||||
// import React from "react";
|
||||
import { signOut } from "next-auth/react";
|
||||
|
||||
type LoginType = "phone" | "account";
|
||||
|
||||
export default function SetPasswordPage() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
// const [loading, setLoading] = useState(false);
|
||||
const { data: session, status } = useSession();
|
||||
const [showOldPassword, setShowOldPassword] = useState<Boolean>(true);
|
||||
// const [showOldPassword, setShowOldPassword] = useState<Boolean>(true);
|
||||
const [setPasswordForm] = Form.useForm();
|
||||
// if (typeof window !== "undefined" && loading) return null;
|
||||
// console.log("2222222", session);
|
||||
@ -34,7 +33,7 @@ export default function SetPasswordPage() {
|
||||
"user[password_confirmation]"?: string;
|
||||
};
|
||||
const onFinish: FormProps<FieldType>["onFinish"] = (values) => {
|
||||
setLoading(true);
|
||||
// setLoading(true);
|
||||
// console.log('-------------', values)
|
||||
// @ts-expect-error
|
||||
fetch(`/api/user/${session?.user?.id}`, {
|
||||
|
@ -1,24 +1,17 @@
|
||||
"use client";
|
||||
|
||||
import { signIn } from "next-auth/react";
|
||||
import React, { useState, useEffect, useRef, use, useMemo } from "react";
|
||||
import React, { useState, useEffect, useMemo } from "react";
|
||||
import { isName } from "@/lib/auth_list";
|
||||
import {
|
||||
Form,
|
||||
Tabs,
|
||||
Input,
|
||||
Button,
|
||||
InputRef,
|
||||
notification as notificationModule,
|
||||
NotificationArgsProps,
|
||||
} from "antd";
|
||||
import {
|
||||
UserOutlined,
|
||||
MailOutlined,
|
||||
LoadingOutlined,
|
||||
AudioOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import type { FormProps, TabsProps } from "antd";
|
||||
import { UserOutlined, MailOutlined, LoadingOutlined } from "@ant-design/icons";
|
||||
import type { FormProps } from "antd";
|
||||
import { SignInOptions } from "next-auth/react";
|
||||
import { getSession } from "next-auth/react";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import styles from "./gpt-prompts.module.scss";
|
||||
import { Flex, Radio, Card } from "antd";
|
||||
import { Flex, Card } from "antd";
|
||||
|
||||
export default function GptPrompts() {
|
||||
return (
|
||||
|
@ -15,7 +15,7 @@ import dynamic from "next/dynamic";
|
||||
import { Path, SlotID } from "../constant";
|
||||
import { ErrorBoundary } from "./error";
|
||||
|
||||
import { getISOLang, getLang } from "../locales";
|
||||
import { getISOLang } from "../locales";
|
||||
|
||||
import {
|
||||
HashRouter as Router,
|
||||
|
@ -6,7 +6,6 @@ import styles from "./new-chat.module.scss";
|
||||
|
||||
import LeftIcon from "../icons/left.svg";
|
||||
import LightningIcon from "../icons/lightning.svg";
|
||||
import EyeIcon from "../icons/eye.svg";
|
||||
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { Mask, useMaskStore } from "../store/mask";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import styles from "@/app/components/mask.module.scss";
|
||||
import Locale from "@/app/locales";
|
||||
import { IconButton } from "@/app/components/button";
|
||||
|
@ -36,7 +36,7 @@ import { removeImage } from "@/app/utils/chat";
|
||||
import { SideBar } from "./sd-sidebar";
|
||||
import { WindowContent } from "@/app/components/home";
|
||||
import { params } from "./sd-panel";
|
||||
import Image from "next/image";
|
||||
|
||||
function getSdTaskStatus(item: any) {
|
||||
let s: string;
|
||||
let color: Property.Color | undefined = undefined;
|
||||
|
@ -25,20 +25,12 @@ import React, {
|
||||
useRef,
|
||||
} from "react";
|
||||
import { IconButton } from "./button";
|
||||
import {
|
||||
Card as AntCard,
|
||||
List as AntList,
|
||||
Row,
|
||||
Col,
|
||||
Grid,
|
||||
Avatar,
|
||||
Button,
|
||||
} from "antd";
|
||||
import { List as AntList, Row, Col } from "antd";
|
||||
import { OpenAIOutlined, GoogleOutlined } from "@ant-design/icons";
|
||||
// 自定义图标
|
||||
import Icon from "@ant-design/icons";
|
||||
|
||||
const { Meta } = AntCard;
|
||||
// const { Meta } = AntCard;
|
||||
import { CheckCard } from "@ant-design/pro-components";
|
||||
import { CheckGroupValueType } from "@ant-design/pro-card/es/components/CheckCard/Group";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Button, Input, Space } from "antd";
|
||||
import { Button, Space } from "antd";
|
||||
import {
|
||||
Dispatch,
|
||||
SetStateAction,
|
||||
|
@ -6,29 +6,10 @@ import { getClientConfig } from "./config/client";
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import { SpeedInsights } from "@vercel/speed-insights/next";
|
||||
import { getServerSideConfig } from "./config/server";
|
||||
// eslint-disable-next-line unused-imports/no-unused-imports
|
||||
import { GoogleTagManager } from "@next/third-parties/google";
|
||||
const serverConfig = getServerSideConfig();
|
||||
import { Providers } from "@/app/providers";
|
||||
// import { Viewport } from "next";
|
||||
|
||||
// export const metadata: Metadata = {
|
||||
// title: "NextChat",
|
||||
// description: "Your personal ChatGPT Chat Bot.",
|
||||
// appleWebApp: {
|
||||
// title: "NextChat",
|
||||
// statusBarStyle: "default",
|
||||
// },
|
||||
// };
|
||||
//
|
||||
// export const viewport: Viewport = {
|
||||
// width: "device-width",
|
||||
// initialScale: 1,
|
||||
// maximumScale: 1,
|
||||
// themeColor: [
|
||||
// { media: "(prefers-color-scheme: light)", color: "#fafafa" },
|
||||
// { media: "(prefers-color-scheme: dark)", color: "#151515" },
|
||||
// ],
|
||||
// };
|
||||
|
||||
export const viewport: Viewport = {
|
||||
themeColor: [
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Mask } from "../store/mask";
|
||||
import { CN_MASKS } from "./cn";
|
||||
import { EN_MASKS } from "./en";
|
||||
// import { CN_MASKS } from "./cn";
|
||||
// import { EN_MASKS } from "./en";
|
||||
|
||||
import { type BuiltinMask } from "./typing";
|
||||
export { type BuiltinMask } from "./typing";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { useMemo } from "react";
|
||||
import { useAccessStore, useAppConfig } from "../store";
|
||||
import { collectModels, collectModelsWithDefaultModel } from "./model";
|
||||
import { collectModelsWithDefaultModel } from "./model";
|
||||
import { useSession } from "next-auth/react";
|
||||
|
||||
export function useAllModels() {
|
||||
|
@ -7,8 +7,8 @@ import prisma from "@/lib/prisma";
|
||||
import { User } from "@prisma/client";
|
||||
import { isEmail, isName } from "@/lib/auth_list";
|
||||
import {createTransport} from "nodemailer";
|
||||
import { comparePassword, hashPassword } from "@/lib/utils";
|
||||
import { randomInt, randomBytes } from "crypto";
|
||||
import { comparePassword } from "@/lib/utils";
|
||||
import { randomBytes } from "crypto";
|
||||
const SECURE_COOKIES:boolean = !!process.env.SECURE_COOKIES;
|
||||
|
||||
let verificationTokens = new Map();
|
||||
|
Loading…
Reference in New Issue
Block a user