fixed axios baseurl
This commit is contained in:
parent
ece305515d
commit
ccf9afacc2
|
@ -730,7 +730,7 @@ eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// lo
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.JSONAPI = void 0;\n\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js\n// console.log('drupalSettings', drupalSettings);\nvar JSONAPI = _axios.default.create({\n baseURL: \"http://dev.materio.com/jsonapi\",\n headers: {\n Accept: 'application/vnd.api+json' // Authorization: 'Bearer {token}',\n // \"Content-Type\": \"application/json\"\n\n }\n});\n\nexports.JSONAPI = JSONAPI;\n\n//# sourceURL=webpack:///./web/themes/custom/materiotheme/vuejs/api/json-axios.js?");
|
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.JSONAPI = void 0;\n\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js\n// console.log('drupalSettings', drupalSettings);\nconsole.log(window.location);\n\nvar JSONAPI = _axios.default.create({\n baseURL: window.location.origin + \"/jsonapi\",\n headers: {\n Accept: 'application/vnd.api+json' // Authorization: 'Bearer {token}',\n // \"Content-Type\": \"application/json\"\n\n }\n});\n\nexports.JSONAPI = JSONAPI;\n\n//# sourceURL=webpack:///./web/themes/custom/materiotheme/vuejs/api/json-axios.js?");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
@ -742,7 +742,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.REST = void 0;\n\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js\n// console.log('drupalSettings', drupalSettings);\nvar REST = _axios.default.create({\n baseURL: \"http://dev.materio.com\",\n headers: {\n Authorization: 'Bearer {token}',\n \"Content-Type\": \"application/json\"\n }\n});\n\nexports.REST = REST;\n\n//# sourceURL=webpack:///./web/themes/custom/materiotheme/vuejs/api/rest-axios.js?");
|
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.REST = void 0;\n\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js\n// console.log('drupalSettings', drupalSettings);\nvar REST = _axios.default.create({\n baseURL: window.location.origin,\n headers: {\n Authorization: 'Bearer {token}',\n \"Content-Type\": \"application/json\"\n }\n});\n\nexports.REST = REST;\n\n//# sourceURL=webpack:///./web/themes/custom/materiotheme/vuejs/api/rest-axios.js?");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,10 @@ import axios from 'axios'
|
||||||
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
|
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
|
||||||
|
|
||||||
// console.log('drupalSettings', drupalSettings);
|
// console.log('drupalSettings', drupalSettings);
|
||||||
|
console.log(window.location);
|
||||||
|
|
||||||
export const JSONAPI = axios.create({
|
export const JSONAPI = axios.create({
|
||||||
baseURL: `http://dev.materio.com/jsonapi`,
|
baseURL: window.location.origin+`/jsonapi`,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.api+json'
|
Accept: 'application/vnd.api+json'
|
||||||
// Authorization: 'Bearer {token}',
|
// Authorization: 'Bearer {token}',
|
||||||
|
|
|
@ -5,7 +5,7 @@ import axios from 'axios'
|
||||||
// console.log('drupalSettings', drupalSettings);
|
// console.log('drupalSettings', drupalSettings);
|
||||||
|
|
||||||
export const REST = axios.create({
|
export const REST = axios.create({
|
||||||
baseURL: `http://dev.materio.com`,
|
baseURL: window.location.origin,
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: 'Bearer {token}',
|
Authorization: 'Bearer {token}',
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
|
|
Loading…
Reference in New Issue