refactor(initialization): 调整镜像源

This commit is contained in:
2025-08-29 00:58:17 +08:00
parent d70112216f
commit 9f6c86dbbc
3 changed files with 25 additions and 34 deletions

View File

@@ -213,7 +213,7 @@ export async function downloadPython(
// 5MB
fs.unlinkSync(zipPath) // 删除无效文件
throw new Error(
`Python下载文件大小异常: ${stats.size} bytes (${(stats.size / 1024).toFixed(2)} KB)可能是镜像站返回的错误页面或无效文件。请选择一个其他可用镜像源进行下载!`
`Python下载文件大小异常: ${stats.size} bytes (${(stats.size / 1024).toFixed(2)} KB)可能是对应镜像站不可用。请选择任意一个其他镜像源进行下载!`
)
}

View File

@@ -1,22 +1,24 @@
<template>
<div class="manual-mode">
<div class="header">
<a-typography-title >AUTO_MAA 初始化向导</a-typography-title>
<a-typography-title :level="4">欢迎使用 AUTO_MAA让我们来配置您的运行环境</a-typography-title>
<a-typography-title>AUTO_MAA 初始化向导</a-typography-title>
<a-typography-title :level="4"
>欢迎使用 AUTO_MAA让我们来配置您的运行环境</a-typography-title
>
<!-- <div class="header-actions">-->
<!-- <a-button size="large" type="primary" @click="handleSkipToHome">-->
<!-- 跳转至首页仅开发用-->
<!-- </a-button>-->
<!-- <a-button-->
<!-- size="large"-->
<!-- type="default"-->
<!-- @click="handleJumpToStep(5)"-->
<!-- style="margin-left: 16px"-->
<!-- >-->
<!-- 跳到启动服务第六步-->
<!-- </a-button>-->
<!-- </div>-->
<!-- <div class="header-actions">-->
<!-- <a-button size="large" type="primary" @click="handleSkipToHome">-->
<!-- 跳转至首页仅开发用-->
<!-- </a-button>-->
<!-- <a-button-->
<!-- size="large"-->
<!-- type="default"-->
<!-- @click="handleJumpToStep(5)"-->
<!-- style="margin-left: 16px"-->
<!-- >-->
<!-- 跳到启动服务第六步-->
<!-- </a-button>-->
<!-- </div>-->
</div>
<a-steps :current="currentStep" :status="stepStatus" class="init-steps">
@@ -107,8 +109,8 @@
</template>
<script setup lang="ts">
import { ref, computed, watch } from 'vue'
import { message } from 'ant-design-vue'
import { ref, watch } from 'vue'
import { notification } from 'ant-design-vue'
import { createComponentLogger } from '@/utils/logger'
import { saveConfig } from '@/utils/config'
import ThemeStep from './ThemeStep.vue'
@@ -298,8 +300,6 @@ async function installPython() {
}
}
async function installGit() {
logger.info('开始安装Git工具')
const result = await window.electronAPI.downloadGit()
@@ -462,11 +462,14 @@ defineExpose({
currentStep,
handleDownloadProgress,
})
// 监听 errorMessage一旦有内容就弹窗
watch(errorMessage, val => {
if (val) {
message.error(val)
notification.error({
message: '出错啦~',
description: val,
duration: 4.5,
})
// 弹窗后可选:自动清空 errorMessage
// errorMessage.value = ''
}

View File

@@ -72,12 +72,6 @@ export const PYTHON_MIRRORS: MirrorConfig[] = [
url: 'https://mirrors.tuna.tsinghua.edu.cn/python/3.12.0/python-3.12.0-embed-amd64.zip',
speed: null,
},
{
key: 'ustc',
name: '中科大镜像',
url: 'https://mirrors.ustc.edu.cn/python/3.12.0/python-3.12.0-embed-amd64.zip',
speed: null,
},
{
key: 'huawei',
name: '华为云镜像',
@@ -120,12 +114,6 @@ export const PIP_MIRRORS: MirrorConfig[] = [
url: 'https://mirrors.aliyun.com/pypi/simple/',
speed: null,
},
{
key: 'douban',
name: '豆瓣',
url: 'https://pypi.douban.com/simple/',
speed: null,
},
]
/**