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 // 5MB
fs.unlinkSync(zipPath) // 删除无效文件 fs.unlinkSync(zipPath) // 删除无效文件
throw new Error( 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> <template>
<div class="manual-mode"> <div class="manual-mode">
<div class="header"> <div class="header">
<a-typography-title >AUTO_MAA 初始化向导</a-typography-title> <a-typography-title>AUTO_MAA 初始化向导</a-typography-title>
<a-typography-title :level="4">欢迎使用 AUTO_MAA让我们来配置您的运行环境</a-typography-title> <a-typography-title :level="4"
>欢迎使用 AUTO_MAA让我们来配置您的运行环境</a-typography-title
>
<!-- <div class="header-actions">--> <!-- <div class="header-actions">-->
<!-- <a-button size="large" type="primary" @click="handleSkipToHome">--> <!-- <a-button size="large" type="primary" @click="handleSkipToHome">-->
<!-- 跳转至首页仅开发用--> <!-- 跳转至首页仅开发用-->
<!-- </a-button>--> <!-- </a-button>-->
<!-- <a-button--> <!-- <a-button-->
<!-- size="large"--> <!-- size="large"-->
<!-- type="default"--> <!-- type="default"-->
<!-- @click="handleJumpToStep(5)"--> <!-- @click="handleJumpToStep(5)"-->
<!-- style="margin-left: 16px"--> <!-- style="margin-left: 16px"-->
<!-- >--> <!-- >-->
<!-- 跳到启动服务第六步--> <!-- 跳到启动服务第六步-->
<!-- </a-button>--> <!-- </a-button>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
<a-steps :current="currentStep" :status="stepStatus" class="init-steps"> <a-steps :current="currentStep" :status="stepStatus" class="init-steps">
@@ -107,8 +109,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch } from 'vue' import { ref, watch } from 'vue'
import { message } from 'ant-design-vue' import { notification } from 'ant-design-vue'
import { createComponentLogger } from '@/utils/logger' import { createComponentLogger } from '@/utils/logger'
import { saveConfig } from '@/utils/config' import { saveConfig } from '@/utils/config'
import ThemeStep from './ThemeStep.vue' import ThemeStep from './ThemeStep.vue'
@@ -298,8 +300,6 @@ async function installPython() {
} }
} }
async function installGit() { async function installGit() {
logger.info('开始安装Git工具') logger.info('开始安装Git工具')
const result = await window.electronAPI.downloadGit() const result = await window.electronAPI.downloadGit()
@@ -462,11 +462,14 @@ defineExpose({
currentStep, currentStep,
handleDownloadProgress, handleDownloadProgress,
}) })
// 监听 errorMessage一旦有内容就弹窗 // 监听 errorMessage一旦有内容就弹窗
watch(errorMessage, val => { watch(errorMessage, val => {
if (val) { if (val) {
message.error(val) notification.error({
message: '出错啦~',
description: val,
duration: 4.5,
})
// 弹窗后可选:自动清空 errorMessage // 弹窗后可选:自动清空 errorMessage
// errorMessage.value = '' // 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', url: 'https://mirrors.tuna.tsinghua.edu.cn/python/3.12.0/python-3.12.0-embed-amd64.zip',
speed: null, 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', key: 'huawei',
name: '华为云镜像', name: '华为云镜像',
@@ -120,12 +114,6 @@ export const PIP_MIRRORS: MirrorConfig[] = [
url: 'https://mirrors.aliyun.com/pypi/simple/', url: 'https://mirrors.aliyun.com/pypi/simple/',
speed: null, speed: null,
}, },
{
key: 'douban',
name: '豆瓣',
url: 'https://pypi.douban.com/simple/',
speed: null,
},
] ]
/** /**