当前位置:首页>python>Python-Ai基于火山方舟&豆包API的全屏实时聊天应用

Python-Ai基于火山方舟&豆包API的全屏实时聊天应用

  • 2026-02-01 06:24:58
Python-Ai基于火山方舟&豆包API的全屏实时聊天应用

点【关注+收藏】实时获取最新的实战代码案例

效果图

基于火山方舟&豆包API的全屏实时聊天应用

本文档提供完整的实时聊天应用实现方案,包含全屏居中布局WebSocket实时通信豆包API集成(基于火山方舟平台),且已移除Token验证,可直接部署使用。

一、项目结构说明

volcano_ark_chat/          # 项目根目录
├── static/                # 静态资源目录(前端页面)
│   └── chat.html          # 全屏聊天界面(核心前端文件)
├── .env                   # 环境变量配置(API密钥等敏感信息)
├── main.py                # 后端核心逻辑(FastAPI+WebSocket+API调用)
└── README.md              # 项目说明文档(本文档)

二、文件内容详解

1. 环境变量配置文件:.env

存储火山方舟API的密钥、URL和模型信息,避免硬编码敏感数据。

# 火山方舟平台API配置(替换为你的实际信息)
VOLCANO_ARK_API_URL=https://ark.cn-beijing.volces.com/api/v3/chat/completions
VOLCANO_ARK_API_KEY=73556896-33e7-4304-9989-c608509397f4ysp  # 你的API密钥
VOLCANO_ARK_MODEL=doubao-seed-1-6-250615                  # 豆包模型名

2. 后端核心逻辑:main.py

基于FastAPI实现WebSocket实时通信,集成豆包API调用,支持消息广播和历史记录。

import os
import json
import asyncio
import aiohttp
from datetime import datetime
from dotenv import load_dotenv
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse

# 加载环境变量
load_dotenv()
app = FastAPI(title="火山方舟实时聊天应用", version="1.0")

# 挂载静态文件(前端页面)
app.mount("/static", StaticFiles(directory="static"), name="static")
templates = Jinja2Templates(directory="static")

# 全局变量:存储消息历史(内存存储,生产环境可替换为Redis)
message_history = []
MAX_HISTORY_LENGTH = 100# 最大历史消息数(避免内存溢出)

# 火山方舟API配置(从.env读取)
ARK_API_URL = os.getenv("VOLCANO_ARK_API_URL")
ARK_API_KEY = os.getenv("VOLCANO_ARK_API_KEY")
ARK_MODEL = os.getenv("VOLCANO_ARK_MODEL")


# ------------------------------
# WebSocket连接管理器(管理在线用户)
# ------------------------------
classConnectionManager:
def__init__(self):
        self.active_connections: list[WebSocket] = []  # 存储所有活跃连接

asyncdefconnect(self, websocket: WebSocket):
"""新用户连接"""
await websocket.accept()
        self.active_connections.append(websocket)
# 发送历史消息给新连接用户
await self.send_history(websocket)

defdisconnect(self, websocket: WebSocket):
"""用户断开连接"""
if websocket in self.active_connections:
            self.active_connections.remove(websocket)

asyncdefbroadcast(self, message: dict):
"""广播消息给所有在线用户"""
# 先将消息加入历史记录
global message_history
        message_history.append(message)
# 截断历史记录(保持最大长度)
if len(message_history) > MAX_HISTORY_LENGTH:
            message_history = message_history[-MAX_HISTORY_LENGTH:]

# 广播消息(JSON字符串格式)
for connection in self.active_connections:
await connection.send_text(json.dumps({
"type""new_message",
"message": message
            }))

asyncdefsend_history(self, websocket: WebSocket):
"""发送历史消息给指定用户"""
await websocket.send_text(json.dumps({
"type""history_messages",
"messages": message_history
        }))


# 初始化连接管理器
manager = ConnectionManager()


# ------------------------------
# 豆包API调用(异步)
# ------------------------------
asyncdefcall_doubao_api(user_query: str) -> str:
"""调用火山方舟豆包API,获取AI回复"""
ifnot ARK_API_KEY ornot ARK_API_URL:
return"错误:未配置火山方舟API密钥或URL"

# API请求参数(符合火山方舟格式)
    payload = {
"model": ARK_MODEL,
"messages": [
            {"role""system""content""你是一个友好的智能助手,回答简洁准确"},
            {"role""user""content": user_query}
        ],
"temperature"0.7,
"max_tokens"1000
    }

# 请求头(包含认证信息)
    headers = {
"Content-Type""application/json",
"Authorization"f"Bearer {ARK_API_KEY}"
    }

try:
# 异步发送API请求(避免阻塞WebSocket)
asyncwith aiohttp.ClientSession() as session:
asyncwith session.post(
                ARK_API_URL,
                headers=headers,
                json=payload,
                timeout=15# 15秒超时
            ) as response:
if response.status == 200:
                    result = await response.json()
return result["choices"][0]["message"]["content"].strip()
else:
                    error_text = await response.text()
returnf"AI请求失败({response.status}):{error_text[:100]}"
except Exception as e:
returnf"AI调用异常:{str(e)[:80]}"


# ------------------------------
# 路由定义
# ------------------------------
@app.get("/", response_class=HTMLResponse)
asyncdefindex():
"""根路径:返回全屏聊天页面"""
return templates.TemplateResponse("chat.html", {"request": {}})


@app.websocket("/ws")
asyncdefwebsocket_endpoint(websocket: WebSocket):
"""WebSocket实时通信端点(核心功能)"""
# 1. 建立连接
await manager.connect(websocket)

try:
# 2. 循环监听客户端消息
whileTrue:
# 接收客户端发送的JSON消息
            data = await websocket.receive_text()
            client_msg = json.loads(data)

# 验证消息格式(必须包含type、username、message)
ifnot all(key in client_msg for key in ["type""username""message"]):
await websocket.send_text(json.dumps({
"type""error",
"message": {"content""消息格式错误,请重试"}
                }))
continue

# 处理"发送消息"请求
if client_msg["type"] == "send_message":
                username = client_msg["username"].strip() or"匿名用户"
                content = client_msg["content"].strip()
                timestamp = datetime.now().strftime("%H:%M:%S")  # 消息时间戳

# 情况1:普通用户消息(直接广播)
ifnot content.startswith("@豆包"):
                    user_message = {
"username": username,
"content": content,
"timestamp": timestamp,
"is_ai"False# 标记为非AI消息
                    }
await manager.broadcast(user_message)

# 情况2:AI交互消息(调用豆包API后广播)
else:
# 1. 先广播用户的AI请求(告知其他用户)
                    ai_request_msg = {
"username": username,
"content": content,
"timestamp": timestamp,
"is_ai"False
                    }
await manager.broadcast(ai_request_msg)

# 2. 提取用户真实查询(去掉"@豆包"前缀)
                    user_query = content.replace("@豆包""").strip()
ifnot user_query:
                        user_query = "你好,我想和你聊天"

# 3. 异步调用豆包API(不阻塞WebSocket循环)
                    ai_response = await call_doubao_api(user_query)

# 4. 广播AI回复
                    ai_message = {
"username""豆包AI",
"content": ai_response,
"timestamp": datetime.now().strftime("%H:%M:%S"),
"is_ai"True# 标记为AI消息(前端区分样式)
                    }
await manager.broadcast(ai_message)

# 3. 处理客户端断开连接
except WebSocketDisconnect:
        manager.disconnect(websocket)
except Exception as e:
# 捕获未知异常,避免服务崩溃
        print(f"WebSocket异常:{str(e)}")
        manager.disconnect(websocket)
await websocket.close(code=1011)  # 服务器内部错误


# ------------------------------
# 启动服务(直接运行main.py即可)
# ------------------------------
if __name__ == "__main__":
import uvicorn
    uvicorn.run(
        app="main:app",
        host="0.0.0.0",
        port=8000,
        reload=True# 开发模式热重载(生产环境关闭)
    )

3. 前端全屏聊天界面:static/chat.html

全屏布局,对话框居中占据大部分空间,支持响应式适配,区分用户/AI/系统消息样式。

<!DOCTYPE html>
<htmllang="zh-CN">
<head>
<metacharset="UTF-8">
<metaname="viewport"content="width=device-width, initial-scale=1.0">
<title>火山方舟 · 豆包AI聊天</title>
<style>
/* 1. 基础样式重置:消除默认边距 */
        * {
margin0;
padding0;
box-sizing: border-box;
        }

/* 2. 全屏布局基础:页面占满屏幕 */
htmlbody {
height100%;
width100%;
overflow: hidden;  /* 隐藏页面滚动条 */
font-family"Microsoft YaHei""Arial", sans-serif;
background-color
#f0f2f5;  /* 浅灰背景,提升层次感 */
        }

/* 3. 外层容器:实现聊天框居中 */
.app-container {
height100vh;    /* 占满视口高度 */
width100vw;     /* 占满视口宽度 */
display: flex;
justify-content: center;  /* 水平居中 */
align-items: center;      /* 垂直居中 */
padding20px;            /* 边距:避免贴边 */
        }

/* 4. 聊天容器:居中且限制最大宽高 */
.chat-container {
display: flex;
flex-direction: column;   /* 垂直排列:头部→消息→输入区 */
width100%;
max-width1200px;        /* 最大宽度:避免宽屏上过宽 */
height95vh;             /* 占视口95%高度:留少量边距 */
max-height900px;        /* 最大高度:避免高屏上过长 */
background-color#ffffff;
border-radius16px;      /* 圆角:现代感 */
box-shadow04px25pxrgba(0000.12);  /* 阴影:增强层次 */
overflow: hidden;         /* 隐藏内部溢出内容 */
        }

/* 5. 聊天头部:标题区 */
.chat-header {
padding18px24px;
background#2196F3;      /* 主题蓝:醒目且专业 */
color#ffffff;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom1px solid #e0e0e0;
        }

.chat-headerh2 {
font-size1.5rem;
font-weight600;
        }

/* 6. 使用提示:引导用户交互 */
.instructions {
font-size0.95em;
color#555555;
padding12px24px;
background#fff8e1;      /* 浅黄背景:提示醒目 */
border-bottom1px solid #ffe082;
        }

/* 7. 消息区域:核心交互区 */
.chat-messages {
flex1;                   /* 占据剩余空间:动态伸缩 */
padding24px;
overflow-y: auto;          /* 消息过多时滚动 */
background-color#f9f9f9/* 浅灰背景:区分消息块 */
        }

/* 8. 消息样式:区分不同类型 */
.message {
margin12px0;
padding12px16px;
border-radius10px;
max-width75%;            /* 消息最大宽度:避免过宽 */
word-wrap: break-word;     /* 长文本换行:防止溢出 */
line-height1.6;          /* 行高:提升可读性 */
        }

/* 8.1 自己的消息:右对齐 */
.user-message {
background#e3f2fd;      /* 浅蓝背景:区分自己 */
margin-left: auto;         /* 右对齐关键样式 */
border-top-right-radius4px/* 小细节:圆角差异化 */
        }

/* 8.2 他人的消息:左对齐 */
.other-message {
background#ffffff;      /* 白色背景:区分他人 */
margin-right: auto;        /* 左对齐关键样式 */
border1px solid #eeeeee;
border-top-left-radius4px;
        }

/* 8.3 系统消息:居中 */
.system-message {
background#e0f7fa;      /* 浅青背景:系统提示 */
color#006064;
margin12px auto;         /* 居中关键样式 */
max-width90%;
text-align: center;
border1px solid #b2ebf2;
        }

/* 8.4 AI消息:左对齐且差异化 */
.ai-message {
background#fff3e0;      /* 浅橙背景:区分AI */
margin-right: auto;
border1px solid #ffe0b2;
border-top-left-radius4px;
        }

/* 9. 消息元数据:用户名+时间 */
.message-meta {
font-size0.8em;
margin-bottom6px;
opacity0.8;              /* 半透明:不喧宾夺主 */
        }

/* 10. 输入区域:底部固定 */
.input-area {
display: flex;
padding18px24px;
background#f5f5f5;      /* 浅灰背景:区分输入区 */
border-top1px solid #eeeeee;
gap16px;                 /* 元素间距:避免拥挤 */
        }

/* 10.1 用户名输入框 */
#username {
width150px;
padding12px16px;
border1px solid #dddddd;
border-radius8px;
font-size1em;
transition: border-color 0.3s/* 边框过渡:交互反馈 */
        }

/* 10.2 消息输入框 */
#message-input {
flex1;                   /* 占据剩余空间:自适应宽度 */
padding12px16px;
border1px solid #dddddd;
border-radius8px;
font-size1em;
transition: all 0.3s;      /* 全属性过渡:交互反馈 */
        }

/* 输入框聚焦样式:提示当前激活状态 */
#username:focus#message-input:focus {
border-color#2196F3;     /* 主题蓝边框:聚焦提示 */
outline: none;             /* 清除默认轮廓 */
box-shadow0003pxrgba(331502430.1); /* 浅蓝阴影:增强聚焦感 */
        }

/* 10.3 发送按钮 */
#send-button {
padding12px24px;
background#2196F3;       /* 主题蓝:醒目可点击 */
color#ffffff;
border: none;
border-radius:

点击【关注+收藏】获取最新的实战代码案例

Python 20天的学习计划

Python的 7 天 学习计划

Python实现类似postman调用

Python实现局域网文件共享神器

Python实现在线书法生成器

Python实现叶子雕刻图

Python证件照多尺寸生成器

Python实现人像证件照背景替换

Python开发自定义打包exe程序

Python实现印章生成器

Python实现简易房租汇总计算器

Python实现哪吒打字打气球

Python实现批量生产证书工厂

Python一键生成带印章的word请假条

Python快捷ps图片取色等编辑器

Python实现批量生产证书工厂

Python快捷ps图片取色等编辑器

Python实现自定义取色器

Python实现自动变成温柔水彩素描

Python实现创意画板代码

用Python打造汉字笔画查询工具:从GUI界面到笔顺动画实现

Python实现表情包制作器

Python实现中国象棋小游戏

Python实现印章生成器

Python模拟实现金山打字通

Python超实用 Markdown 转富文本神器 —— 代码全解析

Python实现贪吃蛇小游戏源码解析

Python实现二维码生成

Python实现视频播放器

Python实现印章生成器

Python实现在线印章制作

Python+Ai实现一个简单的智能语音小助手

Python实现简单记事本

Python实现Markdown转HTML工具代码

Python实现创意画板代码

Python实现简易图画工具代码

Python实现视频播放器

Python实现简单记事本

Python 实现连连看游戏代码解析

Python实现简单电脑进程管理器

Python一个超实用的工具-词频统计工具

Python简易爬虫天气工具

Python定时任务提醒工具

Python《猜数字游戏代码解析》

Python《简易计算器代码解析》

Python+Ai在线文档生成小助手

Python 《密码生成器代码解析》

Python|+Ai实现一个简单的智能语音小助手

Python实现简易图画工具代码

Python实现Markdown转Html

Python实现视频播放器

Python 实现连连看游戏代码解析

Python实现火山AI调用生成故事

Python实现豆包Ai调用生成故事

Python实现简单记事本

Python实现简单电脑进程管理器

实战1

  1. Python:生成二维码生成器

  2. Python-pgame实现迷宫

  3. Python-实现天气时钟小助手

  4. Python-QrCode实现各种二维码

  5. Python-pyglet实现鸿蒙时钟

  6. Python-pickle解析获取微信好友信息

  7. Python-wxPy初版实现微信消息轰炸

  8. Python实现八卦星空时钟

  9. Python实现国庆红旗头像效果

  10. Python-PIL实现图片上指定位置添加图标识

实战2

  1. Python-wxPy初版实现微信消息轰炸

  2. Python-PIL库Image类解析

  3. Python-tlinter实现简单学生管理系统

  4. Python-itChat实现微信消息推发

  5. Python实现Pdf转Word

  6. Python-实现自动生成对联小助手

  7. Py2Exe另外一种方式的打包

  8. Python-tts生成语音转换小助手

  9. python-win32等实现exe自动添加到电脑自启动选项

  10. python实现桌面录制视频

  11. PySimpleGUI-checkboxPython实现图片截取成九宫格

  12. python打包成exe文件

  13. Python-faker生成虚拟数据

  14. python实现播放器Python-FastApi简单实现

  15. python爬取豆瓣电影影评

  16. Python 爬取公众号文章集合

实战3

  1. python实现简易飞花令

  2. python-获取图猜成语的图片

  3. python-menu菜单实现

  4. Python-pySimpleGUI实现界面

  5. Python-彩色图片转换白描

  6. Python-moviepy-实现音视频播放器

  7. Python操作SQLite数据库

  8. Python-PySimpleGUI实现菜单

  9. python-Tkinter实现个性签名

  10. Python-WordCloud云词图

  11. Python-customTkinter的使用

  12. Python-tkinter(下)

  13. Python-tkinter(中)

  14. python-tkinter(1)

  15. Python实现视频小助手

实战4

  1. Python实现视频小助手

  2. Python-flask-1:搭建主页面

  3. Python之tttkbootstrap界面

  4. python-PyQt5实现图片显示和简易阅读器

  5. 在Pycharm上配置Qt Designer 及 Pyuic

  6. Python之PIL实现一寸二寸等图片的裁剪和生成

  7. Python爬取金山词典查询结果

  8. python实现生成个性二维码

  9. AI人机对战版五子棋游戏(AI+pygame实现)

  10. python实现垃圾分类查询器

  11. python-实现菜单menu

  12. Python 领域运用之:自动化测试

  13. Python 领域运用:Web 开发

  14. Python 领域运用:自动化运维

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 02:53:13 HTTP/2.0 GET : https://f.mffb.com.cn/a/467250.html
  2. 运行时间 : 0.294925s [ 吞吐率:3.39req/s ] 内存消耗:4,572.80kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=5683d71e1d91ca8e4f929e72989876ac
  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.000601s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000633s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.017809s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.033309s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000642s ]
  6. SELECT * FROM `set` [ RunTime:0.002788s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000706s ]
  8. SELECT * FROM `article` WHERE `id` = 467250 LIMIT 1 [ RunTime:0.001534s ]
  9. UPDATE `article` SET `lasttime` = 1770490394 WHERE `id` = 467250 [ RunTime:0.006676s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000315s ]
  11. SELECT * FROM `article` WHERE `id` < 467250 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.003078s ]
  12. SELECT * FROM `article` WHERE `id` > 467250 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002300s ]
  13. SELECT * FROM `article` WHERE `id` < 467250 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.056807s ]
  14. SELECT * FROM `article` WHERE `id` < 467250 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.067328s ]
  15. SELECT * FROM `article` WHERE `id` < 467250 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.031644s ]
0.296430s