feat: 增加AI分支
parent
87ffa1d4f9
commit
68c2924285
|
|
@ -1,6 +1,5 @@
|
||||||
import AntechamberHeader from "@/components/AntechamberHeader";
|
import AntechamberHeader from "@/components/AntechamberHeader";
|
||||||
import InvokeButton from "@/components/AntechamberButton";
|
import InvokeButton from "@/components/AntechamberButton";
|
||||||
import AntechamberScore from "@/components/AntechamberScore";
|
|
||||||
|
|
||||||
import { useContext, useEffect, useState } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
import { RealtimeClientContext } from "@/components/Provider/RealtimeClientProvider";
|
import { RealtimeClientContext } from "@/components/Provider/RealtimeClientProvider";
|
||||||
|
|
@ -76,7 +75,6 @@ export default function Antechamber() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center h-full overflow-y-auto relative">
|
<div className="flex flex-col items-center h-full overflow-y-auto relative">
|
||||||
<AntechamberHeader />
|
<AntechamberHeader />
|
||||||
<AntechamberScore />
|
|
||||||
<AntechamberWishList handleLoading={setIsLoading} />
|
<AntechamberWishList handleLoading={setIsLoading} />
|
||||||
<AntechamberFile handleLoading={setIsLoading} />
|
<AntechamberFile handleLoading={setIsLoading} />
|
||||||
<AntechamberReport handleLoading={setIsLoading} />
|
<AntechamberReport handleLoading={setIsLoading} />
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ import WhatsThing from "/icons/whatsThing.png";
|
||||||
import CircleIcon from "/icons/circle.png";
|
import CircleIcon from "/icons/circle.png";
|
||||||
import RightIcon from "/icons/right.png";
|
import RightIcon from "/icons/right.png";
|
||||||
import styles from "./index.module.css";
|
import styles from "./index.module.css";
|
||||||
import { fetchQuestions } from "@/apis/questions";
|
|
||||||
import { useAbortController } from "@/hooks/useAbortController";
|
|
||||||
import { RealtimeClientContext } from "../Provider/RealtimeClientProvider";
|
import { RealtimeClientContext } from "../Provider/RealtimeClientProvider";
|
||||||
// import Countdown from "../Countdown";
|
// import Countdown from "../Countdown";
|
||||||
|
|
||||||
|
|
@ -17,7 +15,6 @@ export default function HeaderGroup() {
|
||||||
|
|
||||||
const { handleConnect } = useContext(RealtimeClientContext);
|
const { handleConnect } = useContext(RealtimeClientContext);
|
||||||
|
|
||||||
const { getSignal } = useAbortController();
|
|
||||||
|
|
||||||
// 随机获取4个问题的函数
|
// 随机获取4个问题的函数
|
||||||
const getRandomQuestions = () => {
|
const getRandomQuestions = () => {
|
||||||
|
|
@ -34,12 +31,7 @@ export default function HeaderGroup() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getQuestion = async () => {
|
const getQuestion = async () => {
|
||||||
const { result, message } = await fetchQuestions({ options: { signal:getSignal() } });
|
setAllQuestions(["济南500分还能上哪些高中?", "第二批志愿怎么填最稳", "指标生和统招生区别"]);
|
||||||
if (message) {
|
|
||||||
console.log(message);
|
|
||||||
} else {
|
|
||||||
setAllQuestions(result as string[]);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -64,7 +56,7 @@ export default function HeaderGroup() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleQuestion = async (question: string) => {
|
const handleQuestion = async (question: string) => {
|
||||||
handleConnect({initMessage:question});
|
handleConnect({ initMessage: question });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -78,26 +70,13 @@ export default function HeaderGroup() {
|
||||||
<div className={styles.main} onClick={handleClick}>
|
<div className={styles.main} onClick={handleClick}>
|
||||||
<img className={styles.thing} src={WhatsThing} alt="whatsThing" />
|
<img className={styles.thing} src={WhatsThing} alt="whatsThing" />
|
||||||
<div className={styles.circle}>
|
<div className={styles.circle}>
|
||||||
<img
|
<img src={CircleIcon} className={isRotating ? styles.rotating : ""} alt="circle" />
|
||||||
src={CircleIcon}
|
|
||||||
className={isRotating ? styles.rotating : ""}
|
|
||||||
alt="circle"
|
|
||||||
/>
|
|
||||||
<div className={styles.change}>换一批</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{displayQuestions.map((item, index) => (
|
{displayQuestions.map((item, index) => (
|
||||||
<div
|
<div className={styles.tip} key={index} onClick={() => handleQuestion(item)}>
|
||||||
className={styles.tip}
|
|
||||||
key={index}
|
|
||||||
onClick={() => handleQuestion(item)}
|
|
||||||
>
|
|
||||||
<div className="text-[14px] text-[#000]">{item}</div>
|
<div className="text-[14px] text-[#000]">{item}</div>
|
||||||
<img
|
<img src={RightIcon} alt="right-icon" className={styles.rightIcon} />
|
||||||
src={RightIcon}
|
|
||||||
alt="right-icon"
|
|
||||||
className={styles.rightIcon}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# 服务器信息
|
# 服务器信息
|
||||||
SERVER_USER="root"
|
SERVER_USER="root"
|
||||||
SERVER_HOST="106.14.30.150"
|
SERVER_HOST="106.14.30.150"
|
||||||
SERVER_PATH="/opt/1panel/apps/openresty/openresty/www/sites/chat.ycymedu.com/index"
|
SERVER_PATH="/opt/1panel/apps/openresty/openresty/www/sites/aizk.ycymedu.com/index"
|
||||||
PRIVATE_KEY="ALIYUN.pem"
|
PRIVATE_KEY="ALIYUN.pem"
|
||||||
BACKUP_PATH="${SERVER_PATH}-backup-$(date +%Y%m%d%H%M%S).zip"
|
BACKUP_PATH="${SERVER_PATH}-backup-$(date +%Y%m%d%H%M%S).zip"
|
||||||
DINGDING_WEBHOOK="https://oapi.dingtalk.com/robot/send?access_token=fca104958fea6273c9c7ef3f08b3d552645c214f929066785e8caf6e1885a5a6"
|
DINGDING_WEBHOOK="https://oapi.dingtalk.com/robot/send?access_token=fca104958fea6273c9c7ef3f08b3d552645c214f929066785e8caf6e1885a5a6"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue