jiachenlong/static/README.md

78 lines
1.7 KiB
Markdown
Raw Normal View History

# 静态资源目录
本目录存放项目的所有静态资源文件。
## 📁 目录结构
```
static/
├── images/ # 图片资源
│ └── logo.jpg # 系统 Logo106KB
├── icons/ # 图标资源
│ ├── favicon.ico # 浏览器标签页图标
│ ├── apple-touch-icon.png
│ └── android-chrome-*.png
└── fonts/ # 字体文件
```
## 📋 文件说明
### images/
- `logo.jpg` - 系统主 Logo用于登录页面和首页
### icons/
- `favicon.ico` - 16x16 浏览器标签页图标
- `apple-touch-icon.png` - 180x180 iOS 设备图标
- `android-chrome-192.png` - 192x192 Android 图标
- `android-chrome-512.png` - 512x512 Android 图标
### fonts/
- 自定义字体文件(如有需要)
## 🎨 资源规范
### Logo
- 格式JPG/PNG/SVG
- 建议尺寸512x512 或更大
- 用途:登录页面、首页、关于页面
### Favicon
- 格式ICO多尺寸包含 16x16, 32x32
- 用途:浏览器标签页、书签
### 应用图标
- 格式PNG透明背景
- 尺寸192x192, 512x512
- 用途PWA、主屏幕快捷方式
## 📦 部署说明
### 后端访问
```python
# FastAPI 挂载静态文件目录
app.mount("/static", StaticFiles(directory="static"), name="static")
```
### 前端访问
```javascript
// 开发环境
<img src="/static/images/logo.jpg" />
// 生产环境(由 Nginx 代理)
<img src="/static/images/logo.jpg" />
```
### Nginx 配置示例
```nginx
# 静态资源
location /static {
alias /path/to/jiachenlong/static;
expires 30d;
add_header Cache-Control "public, immutable";
}
```
---
**最后更新**: 2026-03-16