nuxt.config.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. export default {
  2. // Global page headers (https://go.nuxtjs.dev/config-head)
  3. head: {
  4. title: '合方圆-合天地方圆',
  5. meta: [
  6. { charset: 'utf-8' },
  7. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  8. { hid: 'description', name: 'description', content: '' }
  9. ],
  10. link: [
  11. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  12. ]
  13. },
  14. css: [
  15. '@/assets/public.css'
  16. ],
  17. // Auto import components (https://go.nuxtjs.dev/config-components)
  18. components: true,
  19. // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  20. buildModules: [
  21. '@nuxtjs/tailwindcss'
  22. ],
  23. // Modules (https://go.nuxtjs.dev/config-modules)
  24. modules: [
  25. // https://go.nuxtjs.dev/axios
  26. '@nuxtjs/axios',
  27. ],
  28. // api中间件
  29. serverMiddleware: [
  30. '~/server/index.js'
  31. ],
  32. // Axios module configuration (https://go.nuxtjs.dev/config-axios)
  33. axios: {
  34. proxy: true
  35. },
  36. proxy: {
  37. '/api': {
  38. target: 'http://szhfy.com.cn/', // 目标接口域名
  39. pathRewrite: {
  40. '^/api': '/api', // 把 /api 替换成 /
  41. changeOrigin: true // 表示是否跨域
  42. }
  43. },
  44. '/public': {
  45. target: 'http://szhfy.com.cn/', // 目标接口域名
  46. pathRewrite: {
  47. changeOrigin: true // 表示是否跨域
  48. }
  49. }
  50. },
  51. // Build Configuration (https://go.nuxtjs.dev/config-build)
  52. build: {},
  53. server: {
  54. port: 8000, // default: 3000
  55. host: '0.0.0.0', // default: localhost
  56. }
  57. }