-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
48 lines (46 loc) · 1.09 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
module.exports = {
css: {
loaderOptions: {
stylus: {
'resolve url': true,
'import': []
}
}
},
pluginOptions: {
'cube-ui': {
postCompile: true,
theme: false
}
},
configureWebpack: {
devServer: {
proxy: {
'/api': {
target: 'http://127.0.0.1:3000/',
changOrigin: true
}
}
// before (app) {
// app.get('/api/login', (req, res) => {
// const { username, password } = req.query
// if (username === 'kaikeba' && password === '123') {
// res.json({ code: 1, token: 'jilei' })
// } else {
// res.status(401).json({ code: 0, message: '用户名或密码错误' })
// }
// })
// const auth = (req, res, next) => {
// if (req.headers.token) {
// next()
// } else {
// res.sendStatus(401)
// }
// }
// app.get('/api/userinfo', auth, (req, res) => {
// res.json({ code: 1, data: { name: 'Jerry' } })
// })
// }
}
}
}