mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-03 17:49:46 +08:00
## 新增功能
- 深链导入支持用量查询配置参数:
- `usageEnabled`: 是否启用用量查询
- `usageScript`: Base64 编码的用量查询脚本
- `usageApiKey`: 用量查询专用 API Key
- `usageBaseUrl`: 用量查询专用 Base URL
- `usageAccessToken`: 访问令牌(NewAPI 模板)
- `usageUserId`: 用户 ID(NewAPI 模板)
- `usageAutoInterval`: 自动查询间隔(分钟)
## 修改文件
- **mod.rs**: DeepLinkImportRequest 结构体添加用量查询字段
- **parser.rs**: 解析 URL 中的用量查询参数
- **provider.rs**: 构建 ProviderMeta 包含 UsageScript 配置
- **deeplink.ts**: 添加 TypeScript 类型定义
- **DeepLinkImportDialog.tsx**: 确认对话框显示用量查询配置
## Bug 修复
- **formatters.ts**: 修复 formatJSON() 格式化时删除 "env" 键的问题
## 深链格式示例
```
ccswitch://v1/import?resource=provider&app=claude&name=xxx&usageEnabled=true&usageScript={base64}&usageAutoInterval=30
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>