Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

Commit 0ef36e2

Browse files
committed
feat: add docs
1 parent 99c92bb commit 0ef36e2

File tree

7 files changed

+138
-290
lines changed

7 files changed

+138
-290
lines changed

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<div align="center">
2+
<img src="./docs/icon.svg" alt="预览"/>
3+
4+
<h1 align="center">ChatGPT Admin Web</h1>
5+
6+
免费部署你的商业 ChatGPT 网页应用。
7+
8+
[暂无 Demo] / [Issues](https://github.com/AprilNEA/ChatGPT-Admin-Web/issues) / [Discord](https://discord.gg/y4vxgqfUW) / [Telegram](https://github.com/AprilNEA/ChatGPT-Admin-Web)
9+
10+
[GitHub Sponsor](https://github.com/sponsors/AprilNEA) / [爱发电](https://afdian.net/a/aprilnea)
11+
12+
![主界面](./docs/cover.png)
13+
14+
</div>
15+
16+
## 功能
17+
18+
- 面具 Mask 和提示词列表
19+
- 用户管理、订单管理和订阅管理
20+
- 支付接口
21+
- 第三方支付接口
22+
-[x]虎皮椒
23+
- 文本安全
24+
-[ ] 敏感词过滤
25+
-[x] 第三方过滤
26+
- 模型接入
27+
-[x] OpenAI
28+
-[ ] Bing
29+
- 收益模式
30+
-[ ] 广告
31+
-[ ] 分销
32+
33+
<details><summary>思维导图</summary>
34+
35+
![System](./docs/system.svg)
36+
37+
</details>
38+
39+
## Features
40+
41+
- Mask and prompt list
42+
- User management, order management and subscription management
43+
- Payment interface
44+
- Third party payment interface
45+
-[x]Xunhu Pay
46+
- Text Security
47+
-[ ] Sensitive word filter
48+
-[x] Third-party filtering
49+
- Model Access
50+
-[x] OpenAI
51+
-[ ] Bing
52+
- Revenue model
53+
-[ ] Advertising
54+
-[ ] Distribution
55+
56+
## Start
57+
58+
请查看[文档](https://caw.sku.moe)
59+
60+
Please see [documentation](https://caw.sku.moe)
61+
62+
## 捐赠
63+
64+
感谢您的激励,能让该项目持续发展。
65+
66+
[GitHub Sponsor](https://github.com/sponsors/AprilNEA) | [爱发电](https://afdian.net/a/aprilnea)

apps/chat/.env.template

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,61 @@
1+
# 网站相关设置
12

2-
# Your openai api key. (required)
3-
OPENAI_API_KEY=sk-xxxx
3+
# 这是用来加密用户的令牌的密钥,我们建议您在此生成
4+
# https://1password.com/password-generator/
5+
JWT_SECRET=
6+
# 标题
7+
NEXT_PUBLIC_TITLE=
8+
# 公众号
9+
NEXT_PUBLIC_WECHAT_OA=
410

5-
# Access passsword, separated by comma. (optional)
6-
CODE=your-password
11+
# Database
12+
DATABASE_URL=postgres://<user>:<password>@<host>/<db-name>?pgbouncer=true&connect_timeout=10
13+
DIRECT_URL=postgres://<user>:<password>@<host>/<db-name>?pgbouncer=true&connect_timeout=10
14+
#SHADOW_DATABASE_URL=
715

8-
# You can start service behind a proxy
9-
PROXY_URL=http://localhost:7890
16+
# 如果你想使用 Redis 进行用户速率的限制,你可以在下方填入 U
17+
REDIS_URL=
18+
REDIS_TOKEN=
1019

11-
# Override openai api request base url. (optional)
12-
# Default: https://api.openai.com
13-
# Examples: http://your-openai-proxy.com
14-
BASE_URL=
20+
# 使用 OPENAI 模型的 BASE 和 Key
21+
# 支持 api2d, closeAI 等第三方平台
22+
OPENAI_BASE=https://renailu.deno.dev
23+
OPENAI_KEY=JqHFaJXdFRrU3rjqNqD2
1524

16-
# Specify OpenAI organization ID.(optional)
17-
# Default: Empty
18-
# If you do not want users to input their own API key, set this value to 1.
19-
OPENAI_ORG_ID=
25+
# 支付信息
26+
DOMAIN=https://lmo.best
27+
CALLBACK_DOMAIN=https://wxtest.deno.dev
28+
# 虎皮椒的 appid 和 appsecret
29+
XUNHU_PAY_APPID=
30+
XUNHU_PAY_APPSECRET=
2031

21-
# (optional)
22-
# Default: Empty
23-
# If you do not want users to input their own API key, set this value to 1.
24-
HIDE_USER_API_KEY=
32+
# 若不启用邮箱注册,请将该部分留空
33+
NEXT_PUBLIC_EMAIL_SERVICE=
2534

26-
# (optional)
27-
# Default: Empty
28-
# If you do not want users to use GPT-4, set this value to 1.
29-
DISABLE_GPT4=
35+
MAILGUN_EMAIL_DOMAIN=
36+
MAILGUN_EMAIL_API_KEY=
37+
38+
ELASTICE_EMAIL_API_KEY=
39+
ELASTICE_EMAIL_SENDER=
40+
41+
# SMS 短信
42+
SMS_SERVICE=uni
43+
# UniSMS 的 key
44+
SMS_UNI_KEY_ID=
45+
# 在 UniSMS 中申请的签名,发送+86的短信请保证签名中带有中文
46+
SMS_UNI_SIGNATURE=
47+
48+
# 文本安全配置,当前支持 baidu 或 tencent
49+
TEXT_SECURITY=
50+
51+
TENCENT_SECRETID=
52+
TENCENT_SECRETKEY=
53+
54+
BAIDU_APIKEY=
55+
BAIDU_SECRETKEY=
56+
57+
# 微信登录配置,填入公众号的 appid 和 appsecret
58+
# 公众号必须通过企业认证且为订阅号
59+
WECHAT_PROXY=
60+
WECHAT_APP_ID=
61+
WECHAT_APP_SECRET=

apps/chat/app/components/auth/auth.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import styles from "./auth.module.scss";
2-
import { IconButton } from "../button/button";
2+
import {IconButton} from "../button/button";
33

4-
import { NavigateFunction, useNavigate } from "react-router-dom";
5-
import { Path } from "../../constant";
4+
import {NavigateFunction, useNavigate} from "react-router-dom";
5+
import {Path} from "../../constant";
66

77
import Locale from "../../locales";
88

99
import BotIcon from "../../icons/bot.svg";
10-
import React, { FormEvent, useCallback, useState } from "react";
10+
import React, {FormEvent, useCallback, useState} from "react";
1111

1212
import usePreventFormSubmit from "@/app/hooks/use-prevent-form";
13-
import { useUserStore } from "@/app/store";
14-
import { Input, showToast } from "@/app/components/ui-lib/ui-lib";
13+
import {useUserStore} from "@/app/store";
14+
import {Input, showToast} from "@/app/components/ui-lib/ui-lib";
1515
import Locales from "@/app/locales";
1616
import {
1717
apiUserLoginGet,
@@ -20,9 +20,9 @@ import {
2020
apiUserRegister,
2121
apiUserRegisterCode,
2222
} from "@/app/api";
23-
import { serverStatus } from "@caw/types";
23+
import {serverStatus} from "@caw/types";
2424
import useIntervalAsync from "@/app/hooks/use-interval-async";
25-
import { Loading } from "@/app/components/loading";
25+
import {Loading} from "@/app/components/loading";
2626
import Image from "next/image";
2727

2828
const emailService = process.env.NEXT_PUBLIC_EMAIL_SERVICE;
@@ -64,7 +64,7 @@ const PhoneLogin: React.FC = () => {
6464
Locales.User.PleaseInput(`${Locales.User.Phone}, ${Locales.User.Code}`),
6565
);
6666

67-
const res = await apiUserRegister({ phone: phone, verificationCode: code });
67+
const res = await apiUserRegister({phone: phone, verificationCode: code});
6868

6969
switch (res.status) {
7070
case serverStatus.success: {
@@ -193,7 +193,7 @@ const EmailLogin: React.FC = () => {
193193
</div>
194194

195195
<div className={styles["auth-actions"]}>
196-
<IconButton text={Locale.Auth.Confirm} type="primary" />
196+
<IconButton text={Locale.Auth.Confirm} type="primary"/>
197197
</div>
198198
</div>
199199
);
@@ -202,6 +202,7 @@ const EmailLogin: React.FC = () => {
202202
const WeChatLogin: React.FC = () => {
203203
const navigate = useNavigate();
204204
const [ticket, setTicket] = useState("");
205+
const updateSessionToken = useUserStore((state) => state.updateSessionToken);
205206

206207
useIntervalAsync(
207208
useCallback(async () => {
@@ -221,13 +222,12 @@ const WeChatLogin: React.FC = () => {
221222
return;
222223
}
223224
}
224-
}, [ticket]),
225+
}, [ticket, navigate, updateSessionToken]),
225226
3000,
226227
);
227228

228-
const updateSessionToken = useUserStore((state) => state.updateSessionToken);
229229

230-
if (!ticket) return <Loading noLogo={true} />;
230+
if (!ticket) return <Loading noLogo={true}/>;
231231

232232
return (
233233
<div className={styles["form-container"]}>
@@ -249,15 +249,15 @@ export function AuthPage() {
249249
return (
250250
<div className={styles["auth-page"]}>
251251
<div className={`no-dark ${styles["auth-logo"]}`}>
252-
<BotIcon />
252+
<BotIcon/>
253253
</div>
254254

255255
<div className={styles["auth-title"]}>{Locale.Auth.Title}</div>
256256
<div className={styles["auth-tips"]}>{Locale.Auth.Tips}</div>
257257

258258
<div className={styles["auth-container"]}>
259259
<div className={styles["wechat-part"]}>
260-
<WeChatLogin />
260+
<WeChatLogin/>
261261
</div>
262262

263263
<div className={styles["password-part"]}>
@@ -281,7 +281,7 @@ export function AuthPage() {
281281
</button>
282282
)}
283283
</div>
284-
{tab === "phone" ? <PhoneLogin /> : <EmailLogin />}
284+
{tab === "phone" ? <PhoneLogin/> : <EmailLogin/>}
285285
</div>
286286
</div>
287287
</div>

docs/cover.png

113 KB
Loading

0 commit comments

Comments
 (0)