nuxt.config.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. module.exports = {
  2. ssr: false,
  3. /*
  4. ** Headers of the page
  5. */
  6. head: {
  7. title: 'SEEC软件工程教育云平台', // process.env.npm_package_name || '',
  8. meta: [
  9. { charset: 'utf-8' },
  10. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  11. {
  12. hid: 'description',
  13. name: 'description',
  14. content: process.env.npm_package_description ||
  15. 'SEEC软件工程教育云平台,一个旨在为在校学生或行业内人士,提供系统性自主学习软件工程领域知识服务的平台'
  16. }
  17. ],
  18. link: [
  19. { rel: 'icon', type: 'image/x-icon', href: '/seec.ico' }
  20. ]
  21. },
  22. /*
  23. ** Customize the progress-bar color
  24. */
  25. loading: { color: '#fff' },
  26. /*
  27. ** Global CSS
  28. */
  29. css: [
  30. 'element-ui/lib/theme-chalk/index.css',
  31. { src: '~/assets/css/main.scss', lang: 'scss' }
  32. ],
  33. /*
  34. ** Plugins to load before mounting the App
  35. */
  36. plugins: [
  37. { src: '@/plugins/element-ui', ssr: true },
  38. { src: '~/plugins/vuex-persist', ssr: false },
  39. '~/plugins/api',
  40. '~/plugins/apis',
  41. '~/plugins/apiss',
  42. '~plugins/echarts',
  43. '~/plugins/vue-tour'
  44. ],
  45. /*
  46. ** Nuxt.js dev-modules
  47. */
  48. buildModules: [
  49. ],
  50. /*
  51. ** Nuxt.js modules
  52. */
  53. modules: [
  54. '@nuxtjs/axios',
  55. '@nuxtjs/style-resources',
  56. 'cookie-universal-nuxt',
  57. '@nuxtjs/proxy'
  58. ],
  59. router: {
  60. middleware: 'auth'
  61. },
  62. styleResources: {
  63. scss: './assets/css/main.scss'
  64. },
  65. /*
  66. ** Build configuration
  67. */
  68. build: {
  69. transpile: [/^element-ui/],
  70. /*
  71. ** You can extend webpack config here
  72. */
  73. extend (config, ctx) {
  74. }
  75. },
  76. axios: {
  77. proxy: false,
  78. prefix: '/api', // baseURL
  79. credentials: true
  80. },
  81. proxy: {
  82. '/api/': {
  83. target: 'http://localhost:8080' // 代理地址
  84. // target: 'https://p-server.seec.seecoder.cn' // 代理地址
  85. // changeOrigin: true,
  86. // pathRewrite: {
  87. // '^/api': ''
  88. // },
  89. },
  90. '/apis/': {
  91. // target: 'http://localhost:5000',
  92. target: 'http://47.111.95.164:8080',
  93. pathRewrite: {
  94. '^/apis': '/api'
  95. }
  96. },
  97. '/apiss/': {
  98. // target: 'http://localhost:5000',
  99. target: 'http://47.111.95.164:8080',
  100. pathRewrite: {
  101. '^/apiss': '/api'
  102. }
  103. }
  104. }
  105. // server: {
  106. // https: true
  107. // }
  108. }