Skip to content

Commit b61b6c3

Browse files
committed
写个 readme
1 parent 9bce661 commit b61b6c3

File tree

2 files changed

+45
-20
lines changed

2 files changed

+45
-20
lines changed

README.md

+41-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,55 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1+
# Chat Record Viewer
22

3-
## Getting Started
3+
聊天记录查看器
44

5-
First, run the development server:
5+
本项目是为 [Q2TG](https://github.com/Clansty/Q2TG) 所生,设计上的作用是用于查看合并转发的消息记录。可以根据 ResID 获取并展示转发的聊天记录。
66

7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
```
7+
使用 Next.JS + React,用了 [Antd](https://ant.design/) 的图片放大查看组件。为了防止滥用搭建好的实例,可以设置 secretKey 用于签名校验。
8+
9+
## 搭建方法
10+
11+
1.`config.example.yaml` 复制到 `config.yaml`,填写相关信息
12+
13+
```bash
14+
cp config.example.yaml config.yaml
15+
```
1216

13-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
17+
```yaml
18+
host:
19+
account: # 用于获取记录的帐号
20+
password: # 密码
21+
token: # 随便生成一个密钥,用来校验参数的签名
22+
```
1423
15-
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
24+
2. 安装依赖
1625
17-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.tsx`.
26+
```bash
27+
yarn install
28+
```
1829

19-
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
30+
3. 编译 Next.JS
2031

21-
## Learn More
32+
```bash
33+
yarn build
34+
```
2235

23-
To learn more about Next.js, take a look at the following resources:
36+
4. 运行服务
2437

25-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
38+
```
39+
yarn start
40+
```
2741

28-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
42+
5.`3000` 端口暴露出来,建议使用类似 caddy 的软件反代并提供 HTTPS 连接
43+
44+
## 签名生成
45+
46+
在需要生成访问链接的应用中,使用以下方式生成访问地址的 `sign` 参数
47+
48+
```js
49+
md5(md5(resId) + token)
50+
```
2951

30-
## Deploy on Vercel
52+
该生成算法位于 [`index.tsx` 的第 45 行附近](./pages/index.tsx#L45)
3153

32-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
54+
如果实例部署在 `https://example.com`,则访问地址为 `https://example.com/?res=ResID&sign=签名`
3355

34-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

config.example.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
host:
2+
account:
3+
password:
4+
token:

0 commit comments

Comments
 (0)