1. 自定义头部token

* 修改 `src/utils/request.js`
1
2
3
4
5
6
7
if (store.getters.token) {
// let each request carry token
// ['X-Token'] is a custom headers key
// please modify it according to the actual situation
// config.headers['X-Token'] = getToken()
config.headers['token'] = getToken()
}

2. eslint 报“Expected indentation of 4 spaces but found 6 “错误的解决

1
2
3
// rules中添加如下几行
'space-before-function-paren': 0,
'indent': 'off'

3. 把request.js code的20000 修改为200

1

4. 跨域问题