next.config.ts 721 B

123456789101112131415161718192021222324252627282930313233
  1. /** @type {import('next').NextConfig} */
  2. const nextConfig = {
  3. //代理重定向到后台服务
  4. async rewrites() {
  5. return {
  6. fallback: [
  7. {
  8. source: "/api/system/user",
  9. destination: `${process.env.BACKEND_URL}/system/user/`,
  10. },
  11. {
  12. source: "/api/:path*",
  13. destination: `${process.env.BACKEND_URL}/:path*`,
  14. },
  15. ],
  16. };
  17. },
  18. images: {
  19. dangerouslyAllowSVG: true,
  20. contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
  21. remotePatterns: [
  22. {
  23. protocol: "https",
  24. hostname: "img.shields.io",
  25. port: "",
  26. pathname: "/**",
  27. },
  28. ],
  29. },
  30. };
  31. module.exports = nextConfig;