Browse Source

Refactor http.js

pull/10/head
Hironsan 6 years ago
parent
commit
29c2c92b08
4 changed files with 939 additions and 7 deletions
  1. 312
      app/server/static/bundle/document_classification.js
  2. 312
      app/server/static/bundle/seq2seq.js
  3. 312
      app/server/static/bundle/sequence_labeling.js
  4. 10
      app/server/static/js/http.js

312
app/server/static/bundle/document_classification.js
File diff suppressed because it is too large
View File

312
app/server/static/bundle/seq2seq.js
File diff suppressed because it is too large
View File

312
app/server/static/bundle/sequence_labeling.js
File diff suppressed because it is too large
View File

10
app/server/static/js/http.js

@ -1,8 +1,10 @@
import axios from 'axios';
axios.defaults.xsrfCookieName = 'csrftoken';
axios.defaults.xsrfHeaderName = 'X-CSRFToken';
var base_url = window.location.href.split('/').slice(3, 5).join('/');
let HTTP = axios.create({
baseURL: `/api/${base_url}/`
const baseUrl = window.location.href.split('/').slice(3, 5).join('/');
const HTTP = axios.create({
baseURL: `/api/${baseUrl}/`,
});
export default HTTP;
export default HTTP;
Loading…
Cancel
Save