当前位置:首页>python>【一周精选】Python打造你的专属AI语音助手

【一周精选】Python打造你的专属AI语音助手

  • 2026-06-30 17:13:20
【一周精选】Python打造你的专属AI语音助手

Python打造你的专属AI语音助手!通义千问+Edge-TTS全栈实现,开箱即用

在大模型技术全面普及的今天,拥有一个属于自己的AI助手早已不再是遥不可及的梦想。你是否也曾幻想过,上传一张自己喜欢的头像,就能拥有一个会说话、能思考的专属AI伙伴?它可以陪你聊天、解答问题、甚至用温柔的声音为你朗读回复。

很多人觉得开发这样的AI应用需要掌握复杂的前端框架、后端架构和深度学习技术,但实际上,借助成熟的云服务API和开源工具,我们只用不到200行Python代码就能搭建出一个功能完整、界面精美的AI语音问答助手。

今天要分享的这个项目,集成了阿里云通义千问的强大对话能力和微软Edge-TTS的免费语音合成技术,后端采用高性能的FastAPI框架,前端使用Tailwind CSS打造了现代化的响应式界面。它支持自定义头像上传、多轮自然对话、一键语音播放,所有功能开箱即用,即使是编程新手也能在10分钟内完成部署。

这个项目不仅是一个极佳的全栈开发入门案例,还可以轻松拓展为智能客服、虚拟数字人、有声读物生成器等多种实用工具。接下来,我们将从架构设计、核心代码到部署测试,一步步带你打造属于自己的AI语音助手。

一、项目整体架构与基础配置

本项目采用前后端分离的轻量级架构,技术栈简洁高效,没有任何冗余依赖:

  • 后端:FastAPI(高性能异步Web框架)
  • AI能力:阿里云通义千问API(提供自然语言对话)
  • 语音合成:Edge-TTS(微软免费语音合成服务,无需API密钥)
  • 前端:原生JavaScript + Tailwind CSS(无需构建工具,直接运行)

1.1 基础配置与初始化

首先我们需要导入所需的依赖库,并进行全局配置。这部分代码定义了项目的所有可配置项,你可以根据自己的需求轻松修改模型、音色、服务器端口等参数。

import osimport uuidimport asynciofrom pathlib import Pathfrom fastapi import FastAPI, UploadFile, File, HTTPExceptionfrom fastapi.responses import FileResponse, HTMLResponsefrom fastapi.staticfiles import StaticFilesfrom pydantic import BaseModelimport requestsimport edge_tts# ====================== 配置区域 - 请根据你的实际情况修改 ======================# 阿里云通义千问API密钥(替换为你的真实API密钥)ALIYUN_API_KEY = "你的通义千问API密钥"# 通义千问模型名称ALIYUN_MODEL_NAME = "qwen-turbo"# 语音合成音色(可选:zh-CN-XiaoyiNeural、zh-CN-YunjianNeural等)DEFAULT_VOICE = "zh-CN-XiaoxiaoNeural"# 服务器监听地址和端口HOST = "0.0.0.0"PORT = 8000# 输出目录配置OUTPUT_DIR = Path("./output")STATIC_DIR = Path("./static")# ============================================================================

1.2 FastAPI应用初始化

接下来初始化FastAPI应用,创建必要的文件目录,并挂载静态文件服务。FastAPI会自动为我们生成API文档,访问http://localhost:8000/docs即可查看和测试所有接口。

# 初始化FastAPI应用app = FastAPI(title="AI图片问答助手")# 创建必要的目录OUTPUT_DIR.mkdir(exist_ok=True)STATIC_DIR.mkdir(exist_ok=True)(STATIC_DIR / "audios").mkdir(exist_ok=True)  # 音频存储目录# 挂载静态文件目录app.mount("/static", StaticFiles(directory="static"), name="static")

1.3 数据模型定义

使用Pydantic定义请求数据模型,FastAPI会自动对请求数据进行类型验证和格式检查,确保接口的安全性和健壮性。

# 请求数据模型classChatRequest(BaseModel):    message: str    image_path: str  # 上传的头像图片路径(前端显示用)classTTSRequest(BaseModel):    text: str  # 需要转语音的文本# 全局变量存储对话历史(最多保留10轮)conversation_history = []

二、两大核心功能模块解析

项目的核心能力由通义千问对话模块和Edge-TTS语音合成模块组成,这两个模块相互独立,便于后续替换和升级。

2.1 通义千问对话模块

这个模块负责与阿里云通义千问API进行交互,实现自然语言对话功能。我们维护了一个全局的对话历史列表,让AI能够理解上下文,实现多轮连贯对话。

asyncdefcall_qwen(message: str) -> str:"""调用通义千问API进行对话"""    url = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation"    headers = {"Authorization"f"Bearer {ALIYUN_API_KEY}","Content-Type""application/json"    }# 构建对话历史    messages = conversation_history.copy()    messages.append({"role""user""content": message})    data = {"model": ALIYUN_MODEL_NAME,"input": {"messages": messages},"parameters": {"result_format""message"}    }try:        response = requests.post(url, headers=headers, json=data)        response.raise_for_status()        result = response.json()        assistant_message = result["output"]["choices"][0]["message"]["content"]        conversation_history.append({"role""assistant""content": assistant_message})# 限制历史长度,避免上下文过长导致token超限if len(conversation_history) > 10:            conversation_history.pop(0)            conversation_history.pop(0)return assistant_messageexcept Exception as e:raise HTTPException(status_code=500, detail=f"通义千问调用失败: {str(e)}")

2.2 Edge-TTS语音合成模块

Edge-TTS是微软提供的免费语音合成服务,支持多种语言和音色,音质接近真人。这个模块将AI的文本回复转换为MP3音频文件,供前端播放。

asyncdeftext_to_speech(text: str, output_path: str, voice: str = DEFAULT_VOICE):"""将文本转换为语音"""    communicate = edge_tts.Communicate(text, voice)await communicate.save(output_path)

三、API接口与前端交互设计

我们设计了三个简洁的RESTful API接口,分别处理图片上传、对话请求和语音生成。前端通过Fetch API与后端进行交互,实现流畅的用户体验。

3.1 核心API接口

@app.post("/upload-image")asyncdefupload_image(file: UploadFile = File(...)):"""上传头像图片接口"""# 验证文件格式ifnot file.filename.lower().endswith(('.png''.jpg''.jpeg')):raise HTTPException(status_code=400, detail="只支持PNG和JPG格式的图片")# 生成唯一文件名,避免重名    file_ext = Path(file.filename).suffix    file_id = str(uuid.uuid4())    save_path = STATIC_DIR / f"{file_id}{file_ext}"# 保存上传的文件with open(save_path, "wb"as buffer:        buffer.write(await file.read())return {"image_path": str(save_path),"image_url"f"/static/{file_id}{file_ext}"    }@app.post("/chat")asyncdefchat(request: ChatRequest):"""处理对话请求,返回文本回复"""try:        reply_text = await call_qwen(request.message)return {"text": reply_text}except Exception as e:raise HTTPException(status_code=500, detail=str(e))@app.post("/text-to-speech")asyncdefgenerate_tts(request: TTSRequest):"""文本转语音接口,点击播放时调用"""try:        audio_id = str(uuid.uuid4())        audio_path = STATIC_DIR / "audios" / f"{audio_id}.mp3"await text_to_speech(request.text, str(audio_path))return {"audio_url"f"/static/audios/{audio_id}.mp3"}except Exception as e:raise HTTPException(status_code=500, detail=f"语音生成失败: {str(e)}")

3.2 前端页面实现

前端使用Tailwind CSS实现了现代化的响应式界面,分为左侧头像上传区和右侧对话区。所有交互逻辑都使用原生JavaScript实现,无需任何前端构建工具,直接在浏览器中运行。

@app.get("/", response_class=HTMLResponse)asyncdefget_index():"""返回前端页面"""return"""<!DOCTYPE html><html lang="zh-CN"><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <title>AI图片问答助手</title>    <script src="https://cdn.tailwindcss.com"></script></head><body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen">    <div class="container mx-auto px-4 py-8 max-w-4xl">        <h1 class="text-4xl font-bold text-center mb-8 bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent">            我的专属AI语音助手        </h1>        <div class="grid grid-cols-1 md:grid-cols-2 gap-8">            <!-- 左侧:头像显示区域 -->            <div class="bg-white rounded-2xl shadow-xl p-6 transform hover:scale-[1.02] transition-transform duration-300">                <h2 class="text-2xl font-semibold mb-4 text-gray-700">我的头像</h2>                <!-- 图片上传区域 -->                <div id="upload-area" class="border-2 border-dashed border-gray-300 rounded-xl p-12 text-center mb-4 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all duration-300">                    <input type="file" id="image-input" accept="image/*" class="hidden">                    <div class="text-6xl mb-4 text-gray-400">📷</div>                    <p class="text-gray-500 text-lg">点击上传一张头像照片</p>                </div>                <!-- 头像显示区域 -->                <div id="avatar-container" class="hidden">                    <img id="avatar-img" class="w-full rounded-xl object-cover aspect-square shadow-lg" alt="我的头像">                    <p class="text-sm text-gray-500 text-center mt-4">头像已上传,开始和AI对话吧!</p>                </div>            </div>            <!-- 右侧:聊天区域 -->            <div class="bg-white rounded-2xl shadow-xl p-6 flex flex-col h-[650px] transform hover:scale-[1.02] transition-transform duration-300">                <h2 class="text-2xl font-semibold mb-4 text-gray-700">对话</h2>                <!-- 聊天消息区域 -->                <div id="chat-messages" class="flex-1 overflow-y-auto mb-4 space-y-4 scroll-smooth">                    <div class="text-center text-gray-500 py-12">                        <div class="text-5xl mb-4">🤖</div>                        <p class="text-lg">请先上传头像,然后开始对话</p>                    </div>                </div>                <!-- 输入区域 -->                <div class="flex gap-2">                    <input                         type="text"                         id="message-input"                         class="flex-1 px-4 py-3 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"                        placeholder="输入你的问题..."                        disabled                    >                    <button                         id="send-button"                         class="px-6 py-3 bg-gradient-to-r from-blue-500 to-indigo-500 text-white rounded-xl hover:from-blue-600 hover:to-indigo-600 disabled:from-gray-400 disabled:to-gray-400 disabled:cursor-not-allowed transition-all duration-300 shadow-lg hover:shadow-xl"                        disabled                    >                        发送                    </button>                </div>            </div>        </div>    </div>    <!-- 隐藏的音频播放器 -->    <audio id="audio-player" class="hidden">    <script>        let currentImagePath = null;        let currentAudio = null;        // DOM元素        const uploadArea = document.getElementById('upload-area');        const imageInput = document.getElementById('image-input');        const avatarContainer = document.getElementById('avatar-container');        const avatarImg = document.getElementById('avatar-img');        const chatMessages = document.getElementById('chat-messages');        const messageInput = document.getElementById('message-input');        const sendButton = document.getElementById('send-button');        const audioPlayer = document.getElementById('audio-player');        // 上传图片        uploadArea.addEventListener('click', () => imageInput.click());        imageInput.addEventListener('change', async (e) => {            const file = e.target.files[0];            if (!file) return;            // 显示预览            const reader = new FileReader();            reader.onload = (e) => {                avatarImg.src = e.target.result;                uploadArea.classList.add('hidden');                avatarContainer.classList.remove('hidden');            };            reader.readAsDataURL(file);            // 上传到服务器            const formData = new FormData();            formData.append('file', file);            try {                const response = await fetch('/upload-image', {                    method: 'POST',                    body: formData                });                const result = await response.json();                currentImagePath = result.image_path;                // 启用输入                messageInput.disabled = false;                sendButton.disabled = false;                chatMessages.innerHTML = '<div class="text-center text-gray-500 py-4">开始和AI对话吧!</div>';            } catch (error) {                alert('图片上传失败: ' + error.message);            }        });        // 发送消息        async function sendMessage() {            const message = messageInput.value.trim();            if (!message || !currentImagePath) return;            messageInput.value = '';            addMessage('user', message);            messageInput.disabled = true;            sendButton.disabled = true;            const loadingId = addLoadingMessage();            try {                const response = await fetch('/chat', {                    method: 'POST',                    headers: {'Content-Type': 'application/json'},                    body: JSON.stringify({                        message: message,                        image_path: currentImagePath                    })                });                const result = await response.json();                removeLoadingMessage(loadingId);                addMessage('ai', result.text);            } catch (error) {                removeLoadingMessage(loadingId);                addMessage('system', '发生错误: ' + error.message);            } finally {                messageInput.disabled = false;                sendButton.disabled = false;                messageInput.focus();            }        }        // 添加消息到聊天框        function addMessage(type, content) {            const messageDiv = document.createElement('div');            messageDiv.className = type === 'user'                 ? 'flex justify-end'                 : type === 'system'                ? 'flex justify-center'                : 'flex justify-start items-start gap-3';            const bubbleDiv = document.createElement('div');            bubbleDiv.className = type === 'user'                ? 'bg-gradient-to-r from-blue-500 to-indigo-500 text-white px-4 py-3 rounded-xl max-w-[80%] shadow-md'                : type === 'system'                ? 'bg-red-100 text-red-700 px-4 py-2 rounded-xl text-sm'                : 'bg-gray-100 text-gray-800 px-4 py-3 rounded-xl max-w-[80%] shadow-md';            bubbleDiv.textContent = content;            messageDiv.appendChild(bubbleDiv);            // AI消息添加播放按钮            if (type === 'ai') {                const playButton = document.createElement('button');                playButton.className = 'flex-shrink-0 w-10 h-10 bg-gradient-to-r from-green-500 to-emerald-500 text-white rounded-full hover:from-green-600 hover:to-emerald-600 flex items-center justify-center transition-all duration-300 shadow-lg hover:shadow-xl';                playButton.innerHTML = '▶';                playButton.title = '点击播放语音';                playButton.addEventListener('click', () => playAudio(content, playButton));                messageDiv.insertBefore(playButton, bubbleDiv);            }            chatMessages.appendChild(messageDiv);            chatMessages.scrollTop = chatMessages.scrollHeight;        }        // 添加加载消息        function addLoadingMessage() {            const id = 'loading-' + Date.now();            const messageDiv = document.createElement('div');            messageDiv.id = id;            messageDiv.className = 'flex justify-start';            const bubbleDiv = document.createElement('div');            bubbleDiv.className = 'bg-gray-100 text-gray-800 px-4 py-3 rounded-xl shadow-md';            bubbleDiv.innerHTML = 'AI正在思考... <span class="animate-pulse">...</span>';            messageDiv.appendChild(bubbleDiv);            chatMessages.appendChild(messageDiv);            chatMessages.scrollTop = chatMessages.scrollHeight;            return id;        }        // 移除加载消息        function removeLoadingMessage(id) {            const element = document.getElementById(id);            if (element) element.remove();        }        // 播放语音        async function playAudio(text, button) {            // 停止当前正在播放的音频            if (currentAudio) {                currentAudio.pause();                currentAudio.currentTime = 0;                document.querySelectorAll('button').forEach(btn => {                    if (btn.innerHTML === '⏸') {                        btn.innerHTML = '▶';                        btn.className = btn.className.replace('from-yellow-500 to-amber-500', 'from-green-500 to-emerald-500');                    }                });            }            button.disabled = true;            button.innerHTML = '...';            try {                const response = await fetch('/text-to-speech', {                    method: 'POST',                    headers: {'Content-Type': 'application/json'},                    body: JSON.stringify({ text: text })                });                const result = await response.json();                audioPlayer.src = result.audio_url;                currentAudio = audioPlayer;                audioPlayer.onplay = () => {                    button.innerHTML = '⏸';                    button.className = button.className.replace('from-green-500 to-emerald-500', 'from-yellow-500 to-amber-500');                    button.disabled = false;                };                audioPlayer.onpause = () => {                    button.innerHTML = '▶';                    button.className = button.className.replace('from-yellow-500 to-amber-500', 'from-green-500 to-emerald-500');                };                audioPlayer.onended = () => {                    button.innerHTML = '▶';                    button.className = button.className.replace('from-yellow-500 to-amber-500', 'from-green-500 to-emerald-500');                    currentAudio = null;                };                await audioPlayer.play();            } catch (error) {                alert('语音播放失败: ' + error.message);                button.innerHTML = '▶';                button.disabled = false;            }        }        // 事件监听        sendButton.addEventListener('click', sendMessage);        messageInput.addEventListener('keypress', (e) => {            if (e.key === 'Enter') sendMessage();        });    </script></body></html>    """if __name__ == "__main__":import uvicorn    uvicorn.run(app, host=HOST, port=PORT)

四、核心知识点总结

通过这个项目,你可以掌握以下几个关键的开发技能:

  1. FastAPI快速开发:学习如何使用FastAPI快速构建高性能的RESTful API,包括路由定义、请求参数验证、文件上传处理和静态文件服务。FastAPI的自动文档生成功能可以极大提高开发效率。

  2. 大模型API调用:掌握通义千问API的调用规范,学习如何构建对话历史、处理API响应和异常情况。这是所有大模型应用开发的基础。

  3. 免费语音合成技术:了解Edge-TTS的使用方法,无需任何API密钥即可获得高质量的语音合成能力,支持多种语言和音色。

  4. 前后端分离交互:学习使用原生JavaScript的Fetch API与后端进行异步通信,实现无刷新的用户交互体验。

  5. Tailwind CSS快速开发:掌握Tailwind CSS的实用优先设计理念,无需编写自定义CSS即可快速构建美观的现代化界面。

  6. 异步编程基础:了解Python异步编程的基本概念,使用async/await语法处理IO密集型任务,提高应用的并发性能。

五、拓展场景与测试步骤

5.1 丰富的拓展场景

这个项目具有极强的可拓展性,你可以根据自己的需求进行二次开发:

  • 虚拟数字人助手:结合Live2D或D-ID等数字人技术,让静态头像变成会动、会说话的虚拟数字人
  • 智能客服系统:接入企业知识库,让AI能够回答特定领域的问题,自动处理客户咨询
  • 有声读物生成器:批量导入文本文件,生成带感情的有声读物,支持多种音色切换
  • 语言学习助手:添加发音纠正、语法检查和对话练习功能,帮助用户学习外语
  • 儿童故事机:自定义故事主题和角色,让AI为孩子生成专属的睡前故事并朗读

5.2 详细测试步骤

  1. 环境准备:确保你的电脑安装了Python 3.8或更高版本,打开终端执行以下命令安装依赖:

    pip install fastapi uvicorn requests edge-tts python-multipart
  2. 获取API密钥:访问阿里云百炼官网(https://bailian.console.aliyun.com/),注册账号并创建API密钥,将密钥替换到代码中的对应位置。

  3. 运行服务:将代码保存为main.py,在终端执行以下命令启动服务器:

    python main.py
  4. 测试功能:打开浏览器访问http://localhost:8000,依次测试以下功能:

    • 上传一张PNG或JPG格式的头像图片
    • 在输入框中输入问题,点击发送按钮,等待AI回复
    • 点击AI回复旁边的播放按钮,测试语音播放功能
    • 发送多个问题,测试多轮对话的连贯性
  5. 部署上线:如果需要让其他人访问你的AI助手,可以将项目部署到阿里云、腾讯云等云服务器上,使用Nginx进行反向代理,并配置HTTPS证书。

这个项目展示了如何用最少的代码将大模型能力转化为实用的应用。你可以在此基础上不断添加新功能,打造出属于自己的个性化AI产品。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 21:56:03 HTTP/2.0 GET : https://f.mffb.com.cn/a/494176.html
  2. 运行时间 : 0.387774s [ 吞吐率:2.58req/s ] 内存消耗:4,482.55kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=bdc711babc8fa67ee0b6b2fe819b8e2e
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001094s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001561s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000871s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.002793s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001249s ]
  6. SELECT * FROM `set` [ RunTime:0.003049s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001529s ]
  8. SELECT * FROM `article` WHERE `id` = 494176 LIMIT 1 [ RunTime:0.019014s ]
  9. UPDATE `article` SET `lasttime` = 1783086963 WHERE `id` = 494176 [ RunTime:0.024673s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.002572s ]
  11. SELECT * FROM `article` WHERE `id` < 494176 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.019843s ]
  12. SELECT * FROM `article` WHERE `id` > 494176 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.024046s ]
  13. SELECT * FROM `article` WHERE `id` < 494176 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.053644s ]
  14. SELECT * FROM `article` WHERE `id` < 494176 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.020760s ]
  15. SELECT * FROM `article` WHERE `id` < 494176 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.041721s ]
0.390897s