Initial commit: 心理咨询预约系统
PHP 前后端一体:首页咨询师列表、预约表单、管理后台、二维码准入与邮件通知;敏感配置与提交数据通过 .gitignore 排除。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
12
config/.htaccess
Normal file
12
config/.htaccess
Normal file
@@ -0,0 +1,12 @@
|
||||
<IfModule mod_authz_core.c>
|
||||
<FilesMatch "\.(json)$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
<IfModule !mod_authz_core.c>
|
||||
<FilesMatch "\.(json)$">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
58
config/README.md
Normal file
58
config/README.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# 配置说明
|
||||
|
||||
修改以下文件后,刷新页面即可生效(无需重启 PHP)。
|
||||
|
||||
## 1. 系统配置 `config/app.json`
|
||||
|
||||
| 字段 | 说明 |
|
||||
|------|------|
|
||||
| `siteTitle` | 页面标题 |
|
||||
| `accessToken` | 二维码访问密钥,**部署前务必改为随机长字符串** |
|
||||
| `adminUser` | 管理后台登录账号(默认 `frankfrank`) |
|
||||
| `adminPassword` | 管理后台登录密码(默认 `frankfrank`) |
|
||||
| `servicePhone` | 客服/投诉电话(默认 `13122315169`) |
|
||||
| `confirmPhone` | 确认来电号码(默认 `13122315169`) |
|
||||
| `assetVersion` | (可选)静态资源版本号。留空则**自动**按 css/js 文件修改时间生成;更新后用户会自动加载新样式 |
|
||||
|
||||
## 2. 咨询师列表 `data/doctors.json`
|
||||
|
||||
数组,每位咨询师字段:
|
||||
|
||||
- `id`:唯一标识(英文)
|
||||
- `name`:姓名
|
||||
- `avatar`:头像路径,如 `assets/avatars/song.jpg`
|
||||
- `role`:标签文字,如「副主任医师」「热门咨询师」
|
||||
- `hospital`:所属机构/医院
|
||||
- `fields`:专业领域数组
|
||||
- `bio`:简介(可选)
|
||||
|
||||
头像图片放在 `assets/avatars/` 目录,支持 jpg、png、svg。建议尺寸 **240×240** 正方形,页面会完整展示头像(不裁切)。
|
||||
|
||||
## 3. 提交记录 `data/submissions.json`
|
||||
|
||||
由系统自动写入,**请勿手动编辑**。通过 `admin.html` 登录后导出。
|
||||
|
||||
导出字段:昵称、性别、联系电话、需求简述、所选咨询师等。
|
||||
|
||||
## 4. 邮件通知 `config/mail.json`
|
||||
|
||||
有人提交预约后,系统自动发邮件通知收件人。只需 **SMTP 发信** 配置(POP/IMAP 不需要)。
|
||||
|
||||
| 字段 | 说明 |
|
||||
|------|------|
|
||||
| `enabled` | 是否启用邮件通知(`true` / `false`) |
|
||||
| `recipients` | 收件人邮箱数组,如 `["a@example.com", "b@example.com"]` |
|
||||
| `recipient` | (可选)单个收件人,与 `recipients` 可同时使用 |
|
||||
| `subject` | 邮件标题 |
|
||||
| `smtp.host` | SMTP 服务器,如 `smtp.qiye.aliyun.com` |
|
||||
| `smtp.port` | 端口,SSL 一般为 `465` |
|
||||
| `smtp.encryption` | 加密方式,填 `ssl` |
|
||||
| `smtp.username` | 发信邮箱账号 |
|
||||
| `smtp.password` | 邮箱 SMTP 授权码/密码 |
|
||||
| `smtp.from` | 发件人地址(通常与 username 相同) |
|
||||
| `smtp.fromName` | 发件人显示名称 |
|
||||
|
||||
参考模板见 `config/mail.example.json`。**请勿将含密码的 mail.json 提交到公开仓库。**
|
||||
|
||||
邮件发送失败不影响用户提交成功(数据仍会保存),错误会写入服务器 PHP 日志。
|
||||
|
||||
9
config/app.example.json
Normal file
9
config/app.example.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"siteTitle": "心理咨询",
|
||||
"accessToken": "change_me_to_random_token",
|
||||
"adminUser": "frankfrank",
|
||||
"adminPassword": "change_me",
|
||||
"servicePhone": "13122315169",
|
||||
"confirmPhone": "13122315169",
|
||||
"assetVersion": ""
|
||||
}
|
||||
17
config/mail.example.json
Normal file
17
config/mail.example.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"enabled": true,
|
||||
"recipients": [
|
||||
"your-recipient@example.com",
|
||||
"another@example.com"
|
||||
],
|
||||
"subject": "【心理咨询】新预约提交",
|
||||
"smtp": {
|
||||
"host": "smtp.qiye.aliyun.com",
|
||||
"port": 465,
|
||||
"encryption": "ssl",
|
||||
"username": "your-email@example.com",
|
||||
"password": "your-smtp-password",
|
||||
"from": "your-email@example.com",
|
||||
"fromName": "心理咨询系统"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user