4 Star 8 Fork 4

刘红华/机房信息集中管理系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
nuxt.config.js 3.48 KB
一键复制 编辑 原始数据 按行查看 历史
刘红华 提交于 2023-03-07 11:43 . first
const path = require('path')
const fs = require('fs')
module.exports = {
mode: 'universal',
telemetry: false,
/*
** Headers of the page
*/
head: {
// title: process.env.npm_package_name || '',
title: '机房信息管理系统',
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{hid: 'description', name: 'description', content: process.env.npm_package_description || ''}
],
link: [
{rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
]
},
router: {
middleware: 'metaTitle',
//扩展路由
extendRoutes(routes, resolve) {
// for(item in routes){
// if(routes[item].name === 'index'){routes[item].title = "主页"};
// if(routes[item].name === 'device'){routes[item].title = "设备资料"};
// if(routes[item].name === 'iptable'){routes[item].title = "IP地址表"};
// if(routes[item].name === 'tops'){routes[item].title = "拓扑图"};
// if(routes[item].name === 'index'){routes[item].title = "主页"};
// }
// // routes.push({
// // name:'index',path:'/', meta: {
// // requireAuth: false, //菜单权限
// // title: '欢迎页', //菜单名
// // },
// // })
// console.log(routes);
},
},
/*
** Customize the progress-bar color
*/
// loading: {color: '#fff'},
loading: '~/components/loading.vue',
/*
** Global CSS
*/
css: [
'element-ui/lib/theme-chalk/index.css',
// '@assets/styles/global.less',
],
/*
** Plugins to load before mounting the App
*/
plugins: [
'@/plugins/element-ui',
'@/plugins/umy-ui',
'@/plugins/router',
{
src: '~/plugins/axios',
ssr: true,//服务端渲染
},
],
/*
** Nuxt.js dev-modules
*/
buildModules: [],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'cookie-universal-nuxt',
'@nuxtjs/proxy'
// '@nuxtjs/style-resources'
],
// styleResources: {
// less: '@/assets/vars.less'
// },
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
proxy: true,//开启axios跨域
// prefix:'/fb'
},
proxy: {
// '/files': {
//
// target: 'http://127.0.0.1:8080', // 目标接口域名
//
// // target: 'http://192.168.0.168:9001', // 本地
//
// changeOrigin: true, // 表示是否跨域
//
// pathRewrite: {
// '^/files': '/', // 把 /api 替换成 /
// }
// },
// '/fb': {
// target: 'http://127.0.0.1:8080/fb/', // 目标接口域名
// changeOrigin: true, // 表示是否跨域
//
// pathRewrite: {
// '^/fb': '/', // 把 /fb 替换成 /
// }
// },
// '/api': {
// target: 'http://localhost:3000',//api接口地址
// changeOrigin: true,
// pathRewrite: {
// //'^/api':''
// }
// },
// '/files/*': {
// target: 'http://127.0.0.1:8080',
// changeOrigin: true,
// }
},
/*
** Build configuration
*/
build: {
transpile: [/^element-ui/],
babel:{
"plugins": [
[
"component",
{
"libraryName": "umy-ui",
"styleLibraryName": "theme-chalk"
}
]
]
},
/*
** You can extend webpack config here
*/
extend(config, ctx)
{
}
}
,
server: {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'cert.key')),
cert
:
fs.readFileSync(path.resolve(__dirname, 'cert.crt'))
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/liu_008/itroom.git
git@gitee.com:liu_008/itroom.git
liu_008
itroom
机房信息集中管理系统
master

搜索帮助