-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnuxt.config.js
87 lines (81 loc) · 2.33 KB
/
nuxt.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
titleTemplate: '%s - EasyBlog',
title: 'EasyBlog',
htmlAttrs: {
lang: 'zh',
},
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1,user-scalable=0'},
{hid: 'description', name: 'description', content: ''},
//在此处添加
{name: 'referrer', content: 'no-referrer'},
],
link: [{rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'@/assets/css/flexible_lg.css',
'@/assets/css/flexible_md.css',
'@/assets/css/flexible_sm.css',
'@/assets/css/flexible_xl.css',
'@/assets/css/flexible_xs.css',
'@/assets/css/global.css',
'@/assets/css/verifier.css',
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
{src: '~/plugins/dateFormat.js'},
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
// https://go.nuxtjs.dev/vuetify
'@nuxtjs/vuetify',
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'nuxt-user-agent'
],
axios: {
proxy: true, // 表示开启代理
prefix: '/api', // 表示给请求url加个前缀 /api
credentials: true // 表示跨域请求时是否需要使用凭证
},
proxy: {
'/api': {
target: 'http://api.easyblog.top', // 目标接口域名
changeOrigin: true, // 表示是否跨域
pathRewrite: {
'^/api': '/', // 把 /api 替换成 /
}
},
'/mxnzp-api': {
target: 'https://www.mxnzp.com', // 目标接口域名
changeOrigin: true, // 表示是否跨域
pathRewrite: {
'^/mxnzp-api': '/',
},
},
'/open-api': {
target: 'http://apis.juhe.cn', // 目标接口域名
changeOrigin: true, // 表示是否跨域
pathRewrite: {
'^/open-api': '/',
}
}
},
vuetify: {
customVariables: ['~/assets/scss/variables.scss'],
},
build: {
vendor: ['axios'] //为防止重复打包
}
}