Skip to content

Commit 7d77e98

Browse files
authored
feat: add commonConfigs in Chat. (#278)
1 parent 97ef19d commit 7d77e98

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

docs/restapi/commonChatConfigs.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 13
3+
title: Chat常用配置项修改说明
4+
---
5+
6+
## Chat 常用配置项
7+
8+
| 配置字段名称 | 配置项所在文件 | 配置项说明 | 修改说明 |
9+
| -------------------- | -------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- |
10+
| `api.ports` | `chat-api-chat.yml` | Chat 服务端 api 端口 | 默认为`10008` |
11+
| `api.ports` | `chat-api-admin.yml` | Chat 管理后台 api 端口 | 默认为`10009` |
12+
| `openIM.secret` | `share.yml` | IM 服务端密钥,用于与服务端保持通信 | 默认为 `openIM123`,可更改为任意字符串,需要与服务端密钥保持一致。 |
13+
| `tokenPolicy.expire` | `chat-rpc-admin.yml` | Chat 管理后台 Token 过期时间配置 | expire 的单位为天,默认为 90 |
14+
| `secret` | `chat-rpc-admin.yml` | Chat 管理后台密钥 | 默认为 `chat123` |
15+
| `remainLogLevel` | `log.yml` | 日志级别 | 6:带有调试信息的详细日志,建议开发环境使用;4:info 及关键日志,建议生产环境使用; |
16+
| `allowRegister` | `chat-rpc-chat.yml` | 是否允许用户注册 | 默认为 true |
17+
| `verifyCode` | `chat-rpc-chat.yml` | 验证码相关配置 | 具体参考[验证码 verifyCode](#验证码-verifyCode)|
18+
| `liveKit.url` | `chat-rpc-chat.yml` | LiveKit 服务器的 URL,包括地址和端口 | 默认为`ws://127.0.0.1:7880` |
19+
20+
## 验证码 verifyCode
21+
22+
| **配置选项** | **说明** |
23+
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
24+
| validTime | 验证码有效时间,验证码的有效时间,单位为秒,默认为 5 分钟。 |
25+
| validCount | 单个验证码最大验证尝试次数。 |
26+
| uintTime | 计数周期单位时间,单位为秒。默认为 86400 秒(一天) |
27+
| maxCount | 单个验证码最大验证尝试次数。 |
28+
| superCode | 超级验证码,当`phone.use``mail.use` 的值为`"superCode"`时,使用此字段的值为验证码。默认为`"666666"` |
29+
| len | 生成的验证码长度。 |
30+
| **phone** | **手机验证码配置相关参数** |
31+
| phone.use | 手机验证码生成方式,有`superCode``ali`两种,superCode 是默认预设的验证码,ali 是接入阿里云的短信服务。默认为`superCode`|
32+
| **phone.ali** | **阿里云短信验证服务配置相关参数** |
33+
| phone.ali.endpoint | 阿里云短信服务 API 接入点。 |
34+
| phone.ali.accessKeyId | 阿里云账号的 AccessKey ID。 |
35+
| phone.ali.accessKeySecret | 阿里云账号的 AccessKey 密钥。 |
36+
| phone.ali.signName | 短信发送时显示的签名名称。 |
37+
| phone.ali.verificationCodeTemplateCode | 阿里云短信模板 ID,用于发送验证码。 |
38+
| **mail** | **邮件验证码配置相关参数** |
39+
| mail.use | 手机验证码生成方式,有`superCode``mail`两种,superCode 是默认预设的验证码,mail 是接入自定义的 SMTP 服务。默认为`superCode`|
40+
| mail.title | 发送验证码的邮件标题。 |
41+
| mail.senderMail | 发送验证码的邮箱号。 |
42+
| mail.senderAuthorizationCode | 邮箱的授权码。 |
43+
| mail.smtpAddr | SMTP 服务器地址。 |
44+
| mail.smtpPort | SMTP 服务器端口。 |
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 13
3+
title: Chat Common Configuration
4+
---
5+
6+
## Chat Common Configuration
7+
8+
| Configuration Field Name | Configuration File | Configuration Description | Modification Notes |
9+
| ------------------------ | -------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
10+
| `api.ports` | `chat-api-chat.yml` | Port for Chat service API | Default is `10008` |
11+
| `api.ports` | `chat-api-admin.yml` | Port for Chat admin panel API | Default is `10009` |
12+
| `openIM.secret` | `share.yml` | IM server secret, used to maintain communication with the server | Default is `openIM123`, can be changed to any string, must be consistent with the server secret. |
13+
| `tokenPolicy.expire` | `chat-rpc-admin.yml` | Expiration time configuration for Chat admin panel Token | The unit of expire is days, default is 90 |
14+
| `secret` | `chat-rpc-admin.yml` | Chat admin panel secret | Default is `chat123` |
15+
| `remainLogLevel` | `log.yml` | Log level | 0: Default allows simultaneous login across multiple devices, 1: All clients can be online but only one per client type, 5: PC can be online simultaneously, other clients allow only one device login |
16+
| `allowRegister` | `chat-rpc-chat.yml` | Whether to allow user registration | Default is true |
17+
| `verifyCode` | `chat-rpc-chat.yml` | Verification code related configuration | See [Verification Code verifyCode](#verification-code-verifycode) for details. |
18+
| `liveKit.url` | `chat-rpc-chat.yml` | URL of LiveKit server, including address and port | Default is `ws://127.0.0.1:7880` |
19+
20+
## Verification Code verifyCode
21+
22+
| **Configuration Option** | **Description** |
23+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24+
| validTime | Verification code validity period in seconds, default is 5 minutes. |
25+
| validCount | Maximum number of verification attempts for a single verification code. |
26+
| uintTime | Count cycle unit time in seconds. Default is 86400 seconds (one day). |
27+
| maxCount | Maximum number of verification attempts for a single verification code. |
28+
| superCode | Super verification code, when the value of `phone.use` or `mail.use` is `"superCode"`, the value of this field is used as the verification code. Default is `"666666"`. |
29+
| len | Length of the generated verification code. |
30+
| **phone** | **Parameters related to phone verification code configuration** |
31+
| phone.use | Phone verification code generation method, there are two types: `superCode` and `ali`. superCode is the default preset verification code, ali integrates with Alibaba Cloud SMS service. Default is `superCode`. |
32+
| **phone.ali** | **Parameters related to Alibaba Cloud SMS verification service configuration** |
33+
| phone.ali.endpoint | Alibaba Cloud SMS service API endpoint. |
34+
| phone.ali.accessKeyId | AccessKey ID of Alibaba Cloud account. |
35+
| phone.ali.accessKeySecret | AccessKey secret of Alibaba Cloud account. |
36+
| phone.ali.signName | Signature name displayed when sending SMS. |
37+
| phone.ali.verificationCodeTemplateCode | Alibaba Cloud SMS template ID, used to send verification codes. |
38+
| **mail** | **Parameters related to email verification code configuration** |
39+
| mail.use | Email verification code generation method, there are two types: `superCode` and `mail`. superCode is the default preset verification code, mail integrates with custom SMTP service. Default is `superCode`. |
40+
| mail.title | Email subject for sending verification code. |
41+
| mail.senderMail | Email address used to send verification codes. |
42+
| mail.senderAuthorizationCode | Authorization code for the email. |
43+
| mail.smtpAddr | SMTP server address. |
44+
| mail.smtpPort | SMTP server port. |

0 commit comments

Comments
 (0)