/** * 版本更新相关Mock Handlers */ // 检查版本 - 有新版本 export function mockCheckVersionHasUpdate() { cy.intercept('GET', '/dr/api/v1/auth/settings/package/version*', { statusCode: 200, body: { code: "0x000000", data: { name: "backend", version_pulled: true, new_version_available: true, current_version: "1.14.1", newest_version: "1.15.0", newest_package_size: 104857600, // 100MB newest_time: "2025-12-18T07:00:00Z", newest_md5_sum: "abc123..." } } }).as('checkVersionHasUpdate'); } // 检查版本 - 无新版本 export function mockCheckVersionNoUpdate() { cy.intercept('GET', '/dr/api/v1/auth/settings/package/version*', { statusCode: 200, body: { code: "0x000000", data: { new_version_available: false, current_version: "1.14.1" } } }).as('checkVersionNoUpdate'); } // 下载包API export function mockDownloadPackage() { cy.intercept('POST', '/dr/api/v1/auth/settings/package/download*', { statusCode: 200, body: { code: "0x000000", data: {} } }).as('downloadPackage'); } // 安装包API export function mockInstallPackage() { cy.intercept('POST', '/dr/api/v1/auth/settings/package/install*', { statusCode: 200, body: { code: "0x000000", data: {} } }).as('installPackage'); }