-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
378 lines (377 loc) · 12.3 KB
/
vue.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
const path = require('path')
const debug = process.env.NODE_ENV !== 'production'
module.exports = {
pages: {
adminPage: {
entry: 'src/pages/adminPage/main.js',
template: 'public/admin.html',
filename: 'admin.html',
title: 'admin Page'
},
userPage: {
entry: 'src/pages/userPage/main.js',
template: 'public/index.html',
filename: 'index.html',
title: 'index page'
}
},
publicPath: './', // 根域上下文目录
outputDir: 'dist', // 构建输出目录
assetsDir: 'assets', // 静态资源目录 (js, css, img, fonts)
lintOnSave: true, // 是否开启eslint保存检测,有效值:ture | false | 'error'
runtimeCompiler: true, // 运行时版本是否需要编译
transpileDependencies: [], // 默认babel-loader忽略mode_modules,这里可增加例外的依赖包名
productionSourceMap: true, // 是否在构建生产包时生成 sourceMap 文件,false将提高构建速度
configureWebpack: config => { // webpack配置,值位对象时会合并配置,为方法时会改写配置
if (debug) { // 开发环境配置
config.devtool = 'cheap-module-eval-source-map'
} else { // 生产环境配置
}
Object.assign(config, { // 开发生产共同配置,配置别名
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@c': path.resolve(__dirname, './src/components'),
'vue$': 'vue/dist/vue.esm.js'
}
}
})
},
chainWebpack: config => { // webpack链接API,用于生成和修改webapck配置,
if (debug) {
// 本地开发配置
} else {
// 生产开发配置
}
},
parallel: require('os').cpus().length > 1, // 构建时开启多进程处理babel编译
pluginOptions: { // 第三方插件配置
},
pwa: { // 单页插件相关配置 https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
},
devServer: {
open: true,
host: '127.0.0.1',
port: 80,
https: false,
hotOnly: false,
proxy: { // 配置跨域
'/test': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/test',
ws: true,
changOrigin: true,
pathRewrite: {
'^/test': ''
}
},
'/api_getAllCourse': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_getAllCourse',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_getAllCourse': ''
}
},
'/api_newCourse': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_newCourse',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_newCourse': ''
}
},
'/api_uploadQuestionFile': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_uploadQuestionFile',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_uploadQuestionFile': ''
}
},
'/api_getCourseById': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_getCourseById',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_getCourseById': ''
}
},
'/api_newPaper': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_newPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_newPaper': ''
}
},
'/api_getAllMemberGroup': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_getAllMemberGroup',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_getAllMemberGroup': ''
}
},
'/api_getAllMemberByMemberGroupId': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_getAllMemberByMemberGroupId',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_getAllMemberByMemberGroupId': ''
}
},
'/api_uploadMemberGroupFile': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_uploadMemberGroupFile',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_uploadMemberGroupFile': ''
}
},
'/api_memberDelete': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_memberDelete',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_memberDelete': ''
}
},
'/api_deleteCourse': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_deleteCourse',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_deleteCourse': ''
}
},
'/api_deleteQuestionByType': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_deleteQuestionByType',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_deleteQuestionByType': ''
}
},
'/api_setPaperToExam': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_setPaperToExam',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_setPaperToExam': ''
}
},
'/api_deletePaper': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_deletePaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_deletePaper': ''
}
},
'/api_getAllPaper': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_getAllPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_getAllPaper': ''
}
},
'/api_getAllMemberPaper': {
//要访问的跨域的api的域名
target: 'http://127.0.0.1:8080/api_getAllMemberPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_getAllMemberPaper': ''
}
},
'/user_examLogin': {
//考生登录
target: 'http://127.0.0.1:8080/user_examLogin',
ws: true,
changOrigin: true,
pathRewrite: {
'^/user_examLogin': ''
}
},
'/user_startExaming': {
//考生开考(此时开始抽题)
target: 'http://127.0.0.1:8080/user_startExaming',
ws: true,
changOrigin: true,
pathRewrite: {
'^/user_startExaming': ''
}
},
'/user_saveAnswer': {
//保存一题答案
target: 'http://127.0.0.1:8080/user_saveAnswer',
ws: true,
changOrigin: true,
pathRewrite: {
'^/user_saveAnswer': ''
}
},
'/user_endExaming': {
//结束考核(并计算成绩)
target: 'http://127.0.0.1:8080/user_endExaming',
ws: true,
changOrigin: true,
pathRewrite: {
'^/user_endExaming': ''
}
},
'/user_rewriteLeftMinute': {
//更改剩余分钟数
target: 'http://127.0.0.1:8080/user_rewriteLeftMinute',
ws: true,
changOrigin: true,
pathRewrite: {
'^/user_rewriteLeftMinute': ''
}
},
'/login': {
//登录
target: 'http://127.0.0.1:8080/login',
ws: true,
changOrigin: true,
pathRewrite: {
'^/login': ''
}
},
'/logout': {
//登出
target: 'http://127.0.0.1:8080/logout',
ws: true,
changOrigin: true,
pathRewrite: {
'^/logout': ''
}
},
'/api_endExamForMemberPaper': {
//结束考核
target: 'http://127.0.0.1:8080/api_endExamForMemberPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_endExamForMemberPaper': ''
}
},
'/api_removeMemberPaper': {
//移除考生
target: 'http://127.0.0.1:8080/api_removeMemberPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_removeMemberPaper': ''
}
},
'/api_redoExamForMemberPaper': {
//允许重考
target: 'http://127.0.0.1:8080/api_redoExamForMemberPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_redoExamForMemberPaper': ''
}
},
'/api_downloadMemberPaperList': {
//下载考生信息列表
target: 'http://127.0.0.1:8080/api_downloadMemberPaperList',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_downloadMemberPaperList': ''
}
},
'/api_downloadScore': {
//导出考核成绩
target: 'http://127.0.0.1:8080/api_downloadScore',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_downloadScore': ''
}
},
'/api_endExamForPaper': {
//结束考核(整个考试)
target: 'http://127.0.0.1:8080/api_endExamForPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_endExamForPaper': ''
}
},
'/api_documentPaper': {
//归档试卷
target: 'http://127.0.0.1:8080/api_documentPaper',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_documentPaper': ''
}
},
'/user_getSystemName': {
//获取系统名称
target: 'http://127.0.0.1:8080/user_getSystemName',
ws: true,
changOrigin: true,
pathRewrite: {
'^/user_getSystemName': ''
}
},
'/api_changeSystemName': {
//更改系统名称
target: 'http://127.0.0.1:8080/api_changeSystemName',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_changeSystemName': ''
}
},
'/api_changePassword': {
//更改登录密码
target: 'http://127.0.0.1:8080/api_changePassword',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_changePassword': ''
}
},
'/api_setNewScoreForQuestion': {
//更改该题得分
target: 'http://127.0.0.1:8080/api_setNewScoreForQuestion',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_setNewScoreForQuestion': ''
}
},
'/api_deleteMemberGroup': {
//更改该题得分
target: 'http://127.0.0.1:8080/api_deleteMemberGroup',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api_deleteMemberGroup': ''
}
}
},
before: app => { }
}
}