Files
WYF-koubo/README-CLEAN.md
T
2026-06-20 18:36:36 +08:00

92 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 干净独立工作目录
这是从原目录整理出的独立副本,后续开发、启动和构建请在本目录执行。
## 启动应用
```bat
start-local.bat
```
或:
```bat
npm.cmd run start:local
```
默认会同时启动本地认证服务、Vite 和 Electron。
- 认证服务:`http://127.0.0.1:3302`
- 应用认证 API`http://127.0.0.1:3302/api`
- 管理后台:`http://127.0.0.1:3302/admin/`
- 默认账号:`13800138000`
- 默认密码:`123456`
## 单独启动认证/管理服务
```bat
npm.cmd run auth:local
```
管理后台是从遗失代码中恢复的原版纯静态页面,源码位于 `admin-panel/`;服务端代码位于 `server/local-auth/`。当前为了本地测试,认证服务会顺带托管 `admin-panel/`,之后可以把 `admin-panel/` 单独部署到任意静态站点。
独立部署后台时,默认请求同域 `/api`。如果后台和认证服务不在同一个域名,可以通过 `api` 参数指定认证服务地址:
```text
https://admin.example.com/?api=https://auth.example.com
```
本地测试也可以这样写:
```text
http://127.0.0.1:3302/admin/?api=http://127.0.0.1:3302
```
## 自检
```bat
npm.cmd run start:check
```
## 打包客户端
客户端安装包不包含本地认证服务和管理后台,只会连接你指定的认证服务地址。
```bat
npm.cmd run build:client:win -- --auth-url=https://auth.example.com
```
本地测试可以先只打包目录,速度更快:
```bat
npm.cmd run build:client:win -- --auth-url=http://127.0.0.1:3302 --dir
```
说明:
- `--auth-url` 可以带或不带 `/api`,脚本会自动规范化。
- 打包时会把该地址注入客户端默认配置。
- 运行时仍可通过环境变量 `AUTH_SERVER_URL` 覆盖认证服务地址。
- 打包配置已排除 `server/``admin-panel/``scripts/local-auth-server.cjs``local-auth-data/`
## 系统 API Key 配置
进入 `http://127.0.0.1:3302/admin/` 后,在“系统配置”里填写:
- `aliyun_bailian_api_key`QwenTTS / DashScope API Key
- `aliyun_bailian_base_url`:默认 `https://dashscope.aliyuncs.com/compatible-mode/v1`
- 其他 OSS、RunningHub、火山引擎、云美颜配置也可以在这里维护
这些配置会通过 `/api/system/config/public` 提供给本地应用作为兜底配置。
## 目录结构约定
clean 目录就是后续入库的项目根目录;外层 `aIzhinengti` 只作为临时整理和参考目录。
- 源码放在 `src/``electron/``server/``admin-panel/`
- 打包相关资源统一放在 `packaging/`
- 大型本地依赖放在 `packaging/vendor/`,例如 Python runtime、FFmpeg、Playwright、模型、字体、BGM;这些内容默认不入库。
- 构建输出、运行数据和历史整理残留分别由 `.gitignore``archive/` 隔离。
更完整说明见 `docs/PROJECT_LAYOUT.md``packaging/README.md`