nuxt.config.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. const webpack = require('webpack')
  2. module.exports = {
  3. srcDir: 'src/',
  4. // rootDir: './',
  5. /*
  6. ** Router config
  7. */
  8. router: {
  9. middleware: [
  10. 'check-auth'
  11. ]
  12. },
  13. /*
  14. ** Headers of the page
  15. */
  16. head: {
  17. title: '样本库系统',
  18. meta: [{
  19. charset: 'utf-8'
  20. },
  21. {
  22. name: 'viewport',
  23. content: 'width=device-width, initial-scale=1'
  24. },
  25. {
  26. hid: 'description',
  27. name: 'description',
  28. content: '样本库系统'
  29. }
  30. ],
  31. link: [{
  32. rel: 'icon',
  33. type: 'image/x-icon',
  34. href: '/favicon.ico'
  35. }],
  36. script: [{
  37. src: '/js/utils.js'
  38. },
  39. {
  40. src: '/js/printUtilities.js'
  41. }
  42. ],
  43. },
  44. /*
  45. ** Customize the progress bar color
  46. */
  47. loading: {
  48. color: '#3B8070'
  49. },
  50. /*
  51. ** Build configuration
  52. */
  53. build: {
  54. babel: {
  55. plugins: ['transform-decorators-legacy', 'transform-class-properties']
  56. },
  57. extend(config, {
  58. isDev,
  59. isClient
  60. }) {
  61. config.resolve.alias['class-component'] = '@/plugins/class-component'
  62. },
  63. /*
  64. ** Run ESLint on save
  65. */
  66. // extend (config, ctx) {
  67. // if (ctx.dev && ctx.isClient) {
  68. // config.module.rules.push({
  69. // enforce: 'pre',
  70. // test: /\.(js|vue)$/,
  71. // loader: 'eslint-loader',
  72. // exclude: /(node_modules)/
  73. // })
  74. // }
  75. // },
  76. vendor: [
  77. // 'axios',
  78. 'element-ui',
  79. 'negotiator',
  80. 'vue-class-component',
  81. 'vuex-class',
  82. 'vue-i18n',
  83. 'vue-chartjs',
  84. 'vue-clipboards',
  85. 'moment',
  86. 'chart.js',
  87. 'deepmerge' // vue-chartjs dep
  88. ],
  89. extractCSS: true,
  90. filenames: {
  91. vendor: 'vendor.[hash:12].js',
  92. app: 'shanlan.[chunkhash:12].js',
  93. css: 'shanlan.[contenthash:12].css'
  94. },
  95. plugins: [
  96. new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /zh|en/)
  97. ]
  98. },
  99. /*
  100. ** Global CSS
  101. */
  102. css: [
  103. // 'normalize.css/normalize.css',
  104. 'element-ui/lib/theme-chalk/index.css',
  105. {
  106. src: '~assets/styles/main.scss',
  107. lang: 'scss'
  108. }
  109. // {src: '~assets/mstyles/index.scss', lang: 'scss'}
  110. ],
  111. /*
  112. ** Add element-ui in our app, see plugins/element-ui.js file
  113. */
  114. plugins: [
  115. '@/plugins/i18n',
  116. '@/plugins/element-ui',
  117. // '@/plugins/axios-defaults',
  118. {
  119. src: '@/plugins/clipboard',
  120. ssr: false
  121. },
  122. {
  123. src: '@/plugins/error-handler',
  124. ssr: false
  125. }
  126. ],
  127. modules: [
  128. // '@nuxtjs/auth',
  129. '~/modules/auth',
  130. '@nuxtjs/axios',
  131. ],
  132. auth: {
  133. user: {
  134. endpoint: 'users/me',
  135. propertyName: '',
  136. resetOnFail: true
  137. },
  138. login: {
  139. endpoint: 'auth'
  140. },
  141. logout: {
  142. endpoint: 'auth/logout',
  143. method: 'GET'
  144. },
  145. redirect: {
  146. notLoggedIn: '/login',
  147. loggedIn: '/'
  148. },
  149. token: {
  150. enabled: true,
  151. type: 'Bearer',
  152. localStorage: true,
  153. name: 'token',
  154. cookie: true,
  155. cookieName: 'token'
  156. }
  157. },
  158. axios: {
  159. // baseURL: '//localhost:9081/api/' // 本机开发使用
  160. baseURL: '//47.92.238.200:9081/api/' // BioBank on ALi发布使用
  161. // baseURL: '//188.188.30.89:9081/api/' //临沂使用
  162. // baseURL: '//api09.labsop.cn/api/'
  163. // baseURL: '//192.168.0.211:10091/api/' // 花生所系统
  164. // baseURL: '//121.42.244.202:9081/api/' // 基石发布使用
  165. // proxyHeaders: false
  166. },
  167. /*
  168. ** 客户端和服务端共享的环境变量,
  169. ** 客户端使用:process.env.appclient 服务端使用:context.appclient
  170. */
  171. env: {
  172. appclient: 'biobank', //因顿LIMS:lims,样本库:biobank,细胞制备:cellbank,样本搜索判断,登录跳转判断
  173. // imgserverhost: 'http://localhost:9081', // BioBank服务地址,图片上传文件
  174. imgserverhost: 'http://47.92.238.200:9081', // BioBank服务地址,图片上传文件
  175. upfilehost: 'http://weed1.labsop.cn:9333/dir/assign', // 附件上传
  176. //imgserverhost: 'http://188.188.30.89:9081', // 临沂服务地址,图片上传文件
  177. //upfilehost: '188.188.30.89:9333/dir/assign', // 临沂附件上传
  178. }
  179. }