修改 .env.example,简化 API 配置说明并明确生产环境要求。更新多语言错误提示,确保用户在未启用 API 代理时获得清晰反馈。重构 admin-http.ts,优化 API 基础 URL 的解析逻辑,提升代码可维护性。
28 lines
651 B
TypeScript
28 lines
651 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
import { parseAllowedDevOrigins } from "./src/lib/next-dev-origins";
|
|
|
|
const allowedDevOrigins = parseAllowedDevOrigins(process.env.ALLOWED_DEV_ORIGINS);
|
|
|
|
const nextConfig: NextConfig = {
|
|
/* config options here */
|
|
...(allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}),
|
|
reactCompiler: true,
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: "/admin/service-desk",
|
|
destination: "/admin",
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/admin/menu-permissions",
|
|
destination: "/admin",
|
|
permanent: true,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|