- 新增附件模型与上传服务,拆分头像上传/管理逻辑 - 重构用户资料接口,移除直接修改头像字段,改用专用上传接口 - 添加站点公开设置API与管理员外观配置页 - 全局替换hover背景为accent-soft,优化交互一致性 - 完善头像组件,支持图片加载失败回退与src更新重置 - 新增用户状态事件总线,解决同页头像更新不及时问题 - 调整依赖包顺序与CI依赖版本 - 重构板块列表接口,新增帖子计数 - 迁移账号设置到用户主页tab,合并重复代码
30 lines
753 B
TypeScript
30 lines
753 B
TypeScript
import type { NextConfig } from "next";
|
||
|
||
// 后端地址:开发环境兜底 localhost:3001,生产部署必须显式配置 BACKEND_URL
|
||
const API_TARGET =
|
||
process.env.BACKEND_URL || process.env.NEXT_PUBLIC_API_URL || "http://localhost:3001";
|
||
|
||
const nextConfig: NextConfig = {
|
||
images: {
|
||
minimumCacheTTL: 14400, // 4 小时
|
||
remotePatterns: [
|
||
{ protocol: "http", hostname: "localhost" },
|
||
],
|
||
},
|
||
async rewrites() {
|
||
return [
|
||
{
|
||
source: "/api/:path*",
|
||
destination: `${API_TARGET}/api/:path*`,
|
||
},
|
||
// 用户上传文件(头像等,全部 WebP)
|
||
{
|
||
source: "/uploads/:path*",
|
||
destination: `${API_TARGET}/uploads/:path*`,
|
||
},
|
||
];
|
||
},
|
||
};
|
||
|
||
export default nextConfig;
|