|
@@ -5,10 +5,12 @@ export default function request (url, options = {}) {
|
5
|
5
|
const headers = new Headers();
|
6
|
6
|
headers.append('Content-Type', 'application/json;charset=utf8');
|
7
|
7
|
headers.append('X-Authorization-JWT', getToken());
|
|
8
|
+ // headers.append('credentials', 'include');
|
|
9
|
+ // headers.append('mode', 'cors');
|
8
|
10
|
|
9
|
11
|
Object.keys(options.headers || {}).forEach(key => headers.append(key, options.headers[key]))
|
10
|
12
|
|
11
|
|
- return fetch(url, {...options, headers })
|
|
13
|
+ return fetch(url, {...options, headers, credentials: 'include', mode: 'cors' })
|
12
|
14
|
.then(response => response.json())
|
13
|
15
|
.then(data => {
|
14
|
16
|
if (data.code === 1000) return data.data
|