feat: 支持多项目打包

- config.json 改为按项目存储(projects.<id>),上传配置全局共用;旧单项目配置自动迁移为 readoor
- 新增项目管理(管理员):Git 仓库/凭据、源码目录、Xcode 工程、拷贝条目、配置替换方式、自定义字段、替换规则
- 通用配置替换:pbxproj 版本号与签名,patch_rules 支持 define / replace_line 及 ${app.X}、${server.X} 模板
- 请求通过 X-Project 头选择项目;打包任务记录 project_id,历史按项目过滤
- 前端顶部切换项目,App/服务器环境表单按项目显示字段

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-22 14:59:30 +09:00
co-authored by Claude Opus 5.5
parent 2bd5c7057f
commit 8f2f23682f
19 changed files with 1535 additions and 137 deletions
+9 -2
View File
@@ -51,7 +51,7 @@
</optgroup>
</select>
</div>
<div class="form-group">
<div v-if="supportsObfuscation" class="form-group">
<label>代码混淆</label>
<div class="checkbox-group">
<input type="checkbox" id="obfuscation" v-model="form.obfuscation">
@@ -161,11 +161,15 @@ import { useRoute } from 'vue-router'
const getToken = inject('getToken')
const currentProject = inject('currentProject', ref(''))
const authFetch = (url, options = {}) => {
const token = getToken()
if (token) {
options.headers = { ...options.headers, 'Authorization': `Bearer ${token}` }
}
if (currentProject.value) {
options.headers = { ...options.headers, 'X-Project': currentProject.value }
}
return fetch(url, options)
}
@@ -182,6 +186,9 @@ const filteredApps = computed(() => {
return Object.entries(apps.value).filter(([, app]) => app.server === selectedServer.value)
})
const selectedApp = computed(() => apps.value[form.value.app_id] || null)
const currentProjectInfo = inject('currentProjectInfo', ref(null))
// 未加载到项目信息时(旧版服务)保持原有行为
const supportsObfuscation = computed(() => currentProjectInfo.value?.obfuscation ?? true)
const availableBuildTypes = computed(() => {
const certificates = selectedApp.value?.certificates || {}
return ['Ad_Hoc', 'App_Store'].filter(buildType => Boolean(certificates[buildType]))
@@ -373,7 +380,7 @@ const submitTask = async () => {
const res = await authFetch('/api/tasks', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(form.value),
body: JSON.stringify({ ...form.value, obfuscation: supportsObfuscation.value && form.value.obfuscation }),
})
if (res.ok) {
const task = await res.json()