From bb312441c673b8d2f4a4f76dd815a30af0489fcc Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Fri, 19 May 2023 11:17:20 +0800 Subject: [PATCH] fix: share prompts --- README.md | 3 +- src/pages/index.tsx | 202 +++++++++++++++++++------------------- src/service/utils/auth.ts | 3 +- 3 files changed, 106 insertions(+), 102 deletions(-) diff --git a/README.md b/README.md index fdfc0f769..21d8674e1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ Fast GPT 允许你使用自己的 openai API KEY 来快速的调用 openai 接 ## 🚀 私有化部署 -[docker-compose 部署教程](docs/deploy/docker.md) +- [docker-compose 部署教程](docs/deploy/docker.md) +- [由社区贡献的宝塔部署和本地运行教程](https://space.bilibili.com/431177525/channel/collectiondetail?sid=1370663) ## :point_right: RoadMap diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 1ef4d54c2..fcdd2cbc7 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -26,112 +26,114 @@ const Home = () => { /* 加载动画 */ useEffect(() => { setTimeout(() => { - window.particlesJS?.('particles-js', { - particles: { - number: { - value: 40, - density: { - enable: true, - value_area: 500 - } - }, - color: { - value: '#4e83fd' - }, - shape: { - type: 'circle', - stroke: { - width: 0, - color: '#000000' - }, - polygon: { - nb_sides: 5 - } - }, - opacity: { - value: 0.5, - random: false, - anim: { - enable: false, - speed: 0.1, - opacity_min: 0.1, - sync: false - } - }, - size: { - value: 3, - random: true, - anim: { - enable: false, - speed: 10, - size_min: 0.1, - sync: false - } - }, - line_linked: { - enable: true, - distance: 150, - color: '#adceff', - opacity: 0.4, - width: 1 - }, - move: { - enable: true, - speed: 2, - direction: 'none', - random: true, - straight: false, - out_mode: 'out', - bounce: false, - attract: { - enable: false, - rotateX: 600, - rotateY: 1200 - } - } - }, - interactivity: { - detect_on: 'canvas', - events: { - onhover: { - enable: true, - mode: 'grab' - }, - onclick: { - enable: true, - mode: 'push' - }, - resize: true - }, - modes: { - grab: { - distance: 140, - line_linked: { - opacity: 1 + try { + window.particlesJS?.('particles-js', { + particles: { + number: { + value: 40, + density: { + enable: true, + value_area: 500 } }, - bubble: { - distance: 400, - size: 40, - duration: 2, - opacity: 8, - speed: 3 + color: { + value: '#4e83fd' }, - repulse: { - distance: 200, - duration: 0.4 + shape: { + type: 'circle', + stroke: { + width: 0, + color: '#000000' + }, + polygon: { + nb_sides: 5 + } }, - push: { - particles_nb: 4 + opacity: { + value: 0.5, + random: false, + anim: { + enable: false, + speed: 0.1, + opacity_min: 0.1, + sync: false + } }, - remove: { - particles_nb: 2 + size: { + value: 3, + random: true, + anim: { + enable: false, + speed: 10, + size_min: 0.1, + sync: false + } + }, + line_linked: { + enable: true, + distance: 150, + color: '#adceff', + opacity: 0.4, + width: 1 + }, + move: { + enable: true, + speed: 2, + direction: 'none', + random: true, + straight: false, + out_mode: 'out', + bounce: false, + attract: { + enable: false, + rotateX: 600, + rotateY: 1200 + } } - } - }, - retina_detect: true - }); - }, 1000); + }, + interactivity: { + detect_on: 'canvas', + events: { + onhover: { + enable: true, + mode: 'grab' + }, + onclick: { + enable: true, + mode: 'push' + }, + resize: true + }, + modes: { + grab: { + distance: 140, + line_linked: { + opacity: 1 + } + }, + bubble: { + distance: 400, + size: 40, + duration: 2, + opacity: 8, + speed: 3 + }, + repulse: { + distance: 200, + duration: 0.4 + }, + push: { + particles_nb: 4 + }, + remove: { + particles_nb: 2 + } + } + }, + retina_detect: true + }); + } catch (error) {} + }, 500); }, [isPc]); return ( diff --git a/src/service/utils/auth.ts b/src/service/utils/auth.ts index 4d98447f7..b6fb40b63 100644 --- a/src/service/utils/auth.ts +++ b/src/service/utils/auth.ts @@ -231,7 +231,8 @@ export const authShareChat = async ({ const { model, showModelDetail } = await authModel({ modelId, userId, - authOwner: false + authOwner: false, + reserveDetail: true }); // 获取 user 的 apiKey