签入版本
This commit is contained in:
@@ -7,7 +7,7 @@ Docker 方案适合快速体验项目功能,无需在本机手动安装 PHP、
|
||||
## 架构说明
|
||||
|
||||
```text
|
||||
浏览器 → localhost:8000 → [Nginx 容器:80] → [PHP-FPM 容器:9000] → Laravel 应用
|
||||
浏览器 → admin.laravel13.elevue → [Nginx 容器:80] → [PHP-FPM 容器:9000] → Laravel 应用
|
||||
↕
|
||||
[MySQL 容器:3306] + [Redis 容器:6379]
|
||||
```
|
||||
@@ -151,7 +151,7 @@ services:
|
||||
- JWT_SECRET=${JWT_SECRET:-your_random_jwt_secret_key_at_least_32_bytes_long}
|
||||
|
||||
# 文件访问域名(接口返回上传文件的完整地址)
|
||||
- FILE_DOMAIN_URL=${DOMAIN_URL:-http://localhost:8000}
|
||||
- FILE_DOMAIN_URL=${DOMAIN_URL:-http://admin.laravel13.elevue}
|
||||
|
||||
# 跨域来源(快速体验默认放开)
|
||||
- CORS_ALLOW_ORIGIN=${CORS_ALLOW_ORIGIN:-*}
|
||||
@@ -435,8 +435,8 @@ REDIS_PASSWORD=Your_Redis_Password_2024
|
||||
# 应用
|
||||
JWT_SECRET=<32 字符以上随机值,openssl rand -base64 32 生成>
|
||||
APP_DEBUG=false
|
||||
DOMAIN_URL=http://localhost:8000
|
||||
CORS_ALLOW_ORIGIN=http://localhost:8000
|
||||
DOMAIN_URL=http://admin.laravel13.elevue
|
||||
CORS_ALLOW_ORIGIN=http://admin.laravel13.elevue
|
||||
```
|
||||
|
||||
:::tip 与本地 .env 的关系
|
||||
@@ -460,8 +460,8 @@ CORS_ALLOW_ORIGIN=http://localhost:8000
|
||||
|
||||
| 服务 | 地址 | 说明 |
|
||||
|------|------|------|
|
||||
| 后端 API | http://localhost:8000 | Nginx → PHP-FPM → Laravel |
|
||||
| 健康检查 | http://localhost:8000/up | Laravel 内置健康路由 |
|
||||
| 后端 API | http://admin.laravel13.elevue | Nginx → PHP-FPM → Laravel |
|
||||
| 健康检查 | http://admin.laravel13.elevue/up | Laravel 内置健康路由 |
|
||||
| MySQL | localhost:3306 | 用户名 root,默认密码 root123 |
|
||||
| Redis | localhost:6379 | 默认密码 redis123 |
|
||||
|
||||
@@ -469,15 +469,15 @@ CORS_ALLOW_ORIGIN=http://localhost:8000
|
||||
|
||||
```bash
|
||||
# 健康检查
|
||||
curl http://localhost:8000/up
|
||||
curl http://admin.laravel13.elevue/up
|
||||
|
||||
# 验证码(同时验证 PHP→Redis 链路,返回 code=0 即成功)
|
||||
curl http://localhost:8000/api/captcha
|
||||
curl http://admin.laravel13.elevue/api/captcha
|
||||
# → {"code":0,"ok":true,"msg":"操作成功","data":{...}}
|
||||
|
||||
# 登录获取 Token(默认管理员账号 admin / 123456,登录后立即修改)
|
||||
# 验证码参数 key/code 与 /api/captcha 响应字段一致
|
||||
curl -X POST http://localhost:8000/api/login \
|
||||
curl -X POST http://admin.laravel13.elevue/api/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"admin","password":"123456","key":"<captcha_key>","code":"<验证码字符>"}'
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user