fix: 皮肤包删除后被自动迁移逻辑复活,IPA 下载连击刷屏操作日志
_migrate_old_themes 之前每次 load_config() 都会重跑,只要证书仍引用某皮肤 且旧版 themes 目录还在,删除后会被立即重新生成;现改为仅首次执行一次并 在 config.json 中打标记跳过后续调用。 打包历史下载 IPA 按钮此前无连击防护,前端加 in-flight 禁用态,后端对同一 用户同一任务的下载操作日志增加 5 秒去重,避免连击刷屏审计日志。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
84a2d3db01
commit
c17b7d5ad9
@@ -56,7 +56,7 @@
|
||||
<img v-if="task.build_type === 'Ad_Hoc' && task.qr_code_path"
|
||||
:src="task.qr_code_path" alt="QR" class="qr-thumb"
|
||||
@click="showQrPreview(task)">
|
||||
<button v-if="task.build_type === 'App_Store'" class="download-link" @click="downloadIpa(task.id)">下载 IPA</button>
|
||||
<button v-if="task.build_type === 'App_Store'" class="download-link" :disabled="!!downloadingIds[task.id]" @click="downloadIpa(task.id)">{{ downloadingIds[task.id] ? '下载中...' : '下载 IPA' }}</button>
|
||||
</template>
|
||||
<span v-else class="text-muted">-</span>
|
||||
</td>
|
||||
@@ -159,7 +159,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, nextTick, onUnmounted, inject } from 'vue'
|
||||
import { ref, reactive, computed, onMounted, nextTick, onUnmounted, inject } from 'vue'
|
||||
|
||||
const getToken = inject('getToken', () => '')
|
||||
const isAdmin = inject('isAdmin', ref(false))
|
||||
@@ -182,6 +182,7 @@ const logContainer = ref(null)
|
||||
const showVerboseLogs = ref(false)
|
||||
const qrPreview = ref(null)
|
||||
const showSuperseded = ref(false)
|
||||
const downloadingIds = reactive({})
|
||||
let logWs = null
|
||||
|
||||
const getAppVersion = (task) => {
|
||||
@@ -313,6 +314,8 @@ const downloadDsym = (taskId) => {
|
||||
}
|
||||
|
||||
const downloadIpa = async (taskId) => {
|
||||
if (downloadingIds[taskId]) return
|
||||
downloadingIds[taskId] = true
|
||||
try {
|
||||
const res = await authFetch(`/api/tasks/${taskId}/download-link`)
|
||||
if (!res.ok) throw new Error()
|
||||
@@ -320,6 +323,8 @@ const downloadIpa = async (taskId) => {
|
||||
window.open(url, '_blank')
|
||||
} catch {
|
||||
alert('下载失败,请稍后重试')
|
||||
} finally {
|
||||
delete downloadingIds[taskId]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,6 +529,8 @@ const errorCategoryLabel = (cat) => {
|
||||
.btn-close-log:hover { border-color: #1890ff; color: #1890ff; }
|
||||
.download-link { color: #1890ff; text-decoration: none; font-size: 13px; border: none; background: none; cursor: pointer; padding: 0; }
|
||||
.download-link:hover { text-decoration: underline; }
|
||||
.download-link:disabled { color: #999; cursor: default; }
|
||||
.download-link:disabled:hover { text-decoration: none; }
|
||||
.text-muted { color: #999; font-size: 13px; }
|
||||
.qr-thumb { width: 40px; height: 40px; cursor: pointer; border-radius: 4px; border: 1px solid #e8e8e8; }
|
||||
.qr-thumb:hover { border-color: #1890ff; }
|
||||
|
||||
Reference in New Issue
Block a user