修改数据库配置
This commit is contained in:
31
README.md
31
README.md
@@ -156,15 +156,34 @@ pnpm tauri build
|
||||
## 配置说明
|
||||
|
||||
### 数据库配置
|
||||
数据库连接配置位于 `src-tauri/src/lib.rs`:
|
||||
|
||||
```rust
|
||||
let db_url = "postgres://tmstools:521707@honulla.com:5432/tmstools";
|
||||
本应用使用 **PostgreSQL** 数据库进行数据持久化存储。数据库连接配置通过本地配置文件管理。
|
||||
|
||||
#### 配置文件位置
|
||||
所有平台统一使用 `~/.config/` 目录:
|
||||
- **macOS**: `~/.config/tms_tools/config.toml`
|
||||
- **Windows**: `~/.config/tms_tools/config.toml`
|
||||
- **Linux**: `~/.config/tms_tools/config.toml`
|
||||
|
||||
#### 配置文件格式
|
||||
|
||||
在启动应用前,需要手动创建配置文件:
|
||||
|
||||
```toml
|
||||
database_url = "postgres://用户名:密码@主机地址:端口/数据库名"
|
||||
```
|
||||
|
||||
### 外部 API
|
||||
- 登录接口: `https://c.baobaot.com/user/ajax_login`
|
||||
- 工单平台: `https://c.baobaot.com/cinema/workorder`
|
||||
**示例:**
|
||||
```toml
|
||||
database_url = "postgres://tmstools:521707@localhost:5432/tmstools"
|
||||
```
|
||||
|
||||
#### 启动检查
|
||||
|
||||
应用启动时会自动检查配置文件:
|
||||
- ✅ 配置文件存在且格式正确 → 正常启动
|
||||
- ❌ 配置文件不存在 → 弹出错误提示,点击确定后退出
|
||||
- ❌ 数据库连接失败 → 在登录时提示错误
|
||||
|
||||
## 开发计划
|
||||
|
||||
|
||||
Reference in New Issue
Block a user