Centralized APP_URL var into vuex store
This commit is contained in:
parent
f3bcfc0e72
commit
3f383e6527
10 changed files with 43 additions and 38 deletions
8
motorradig/.idea/workspace.xml
generated
8
motorradig/.idea/workspace.xml
generated
|
|
@ -3,13 +3,13 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="eed7de89-f054-487c-bf59-36356758942b" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/FileController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/FileController.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/public/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/app.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/public/upload/images/Superordner2/Gazprom.png" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/public/upload/images/Superordner2/mod1.png" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/app.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/store.js" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/store.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/views/EditPage.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/EditPage.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/views/Gallery.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/Gallery.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/views/Main.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/Main.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/views/Upload.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/Upload.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/js/views/UserList.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/UserList.vue" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
|
|||
36
motorradig/public/js/app.js
vendored
36
motorradig/public/js/app.js
vendored
|
|
@ -1925,7 +1925,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this = this;
|
||||
|
||||
console.log('Saving to page:' + this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/save_page', {
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
}, {
|
||||
|
|
@ -2052,7 +2052,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this = this;
|
||||
|
||||
console.log('Saving to page:' + this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/save_page', {
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
}, {
|
||||
|
|
@ -2075,7 +2075,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
formData.append('image', selectedFile);
|
||||
formData.append('folder', selectedFolder);
|
||||
axios.post('http://localhost:8000/api/v1/auth/upload', formData, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/upload', formData, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -2091,7 +2091,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
console.log("Request creation of folder:" + folderName);
|
||||
var formData = new FormData();
|
||||
formData.append("folder", folderName);
|
||||
axios.post('http://localhost:8000/api/v1/auth/create_folder', formData, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/create_folder', formData, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -2108,7 +2108,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this3 = this;
|
||||
|
||||
console.log("Requesting folders with images");
|
||||
axios.post('http://localhost:8000/api/v1/auth/get_folders_with_images', {}, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/get_folders_with_images', {}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -2225,7 +2225,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
console.log("logging out with token " + this.$store.state.user_token); // Empty brackets are an empty object usually containing form data
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/auth/logout', {}, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/logout', {}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -2255,7 +2255,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
console.log("loadPage: " + page_name);
|
||||
this.$store.state.page_name = page_name;
|
||||
axios.post('http://localhost:8000/api/v1/load_page', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/load_page', {
|
||||
page: page_name
|
||||
}, {
|
||||
headers: {
|
||||
|
|
@ -2395,7 +2395,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this = this;
|
||||
|
||||
console.log('Saving to page:' + this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/save_page', {
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
}, {
|
||||
|
|
@ -2418,7 +2418,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
formData.append('image', selectedFile);
|
||||
formData.append('folder', selectedFolder);
|
||||
axios.post('http://localhost:8000/api/v1/auth/upload', formData, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/upload', formData, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -2434,7 +2434,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
console.log("Request creation of folder:" + folderName);
|
||||
var formData = new FormData();
|
||||
formData.append("folder", folderName);
|
||||
axios.post('http://localhost:8000/api/v1/auth/create_folder', formData, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/create_folder', formData, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -2451,7 +2451,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this3 = this;
|
||||
|
||||
console.log("Requesting folders");
|
||||
axios.post('http://localhost:8000/api/v1/auth/get_folders', {}, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/get_folders', {}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -2547,7 +2547,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
console.log("logging out with token " + this.$store.state.user_token); // Empty brackets are an empty object usually containing form data
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/auth/logout', {}, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/logout', {}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -2570,7 +2570,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
console.log("loadPage: " + page_name);
|
||||
this.$store.state.page_name = page_name;
|
||||
axios.post('http://localhost:8000/api/v1/load_page', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/load_page', {
|
||||
page: page_name
|
||||
}, {
|
||||
headers: {
|
||||
|
|
@ -2586,7 +2586,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this3 = this;
|
||||
|
||||
// Empty brackets are an empty object usually containing form data
|
||||
axios.post('http://localhost:8000/api/v1/auth/get_userlist', {}, {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/get_userlist', {}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -2604,7 +2604,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
console.log("Setting new role for userid " + user_id + ": " + role); // Empty brackets are an empty object usually containing form data
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/auth/set_role', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/set_role', {
|
||||
user_id: user_id,
|
||||
role: role
|
||||
}, {
|
||||
|
|
@ -2621,7 +2621,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
console.log("Deleting userid " + user_id); // Empty brackets are an empty object usually containing form data
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/auth/delete_user', {
|
||||
axios.post(this.$store.state.app_url + '/api/v1/auth/delete_user', {
|
||||
user_id: user_id
|
||||
}, {
|
||||
headers: {
|
||||
|
|
@ -49219,7 +49219,9 @@ var store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
|
|||
page_content: '<h1 style="font-align:center;">Placeholder</h1>',
|
||||
userlist: {},
|
||||
folders: {},
|
||||
selectedFolder: "default"
|
||||
selectedFolder: "default",
|
||||
//app_url:"http://www.programmschmiede.de"
|
||||
app_url: "http://www.localhost:8000"
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
BIN
motorradig/public/upload/images/Superordner3/Shell B.png
Normal file
BIN
motorradig/public/upload/images/Superordner3/Shell B.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
5
motorradig/resources/js/store.js
vendored
5
motorradig/resources/js/store.js
vendored
|
|
@ -10,6 +10,9 @@ export const store = new Vuex.Store({
|
|||
page_content:'<h1 style="font-align:center;">Placeholder</h1>',
|
||||
userlist:{},
|
||||
folders:{},
|
||||
selectedFolder:"default"
|
||||
selectedFolder:"default",
|
||||
|
||||
//app_url:"http://www.programmschmiede.de"
|
||||
app_url:"http://www.localhost:8000"
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
},
|
||||
savePage() {
|
||||
console.log('Saving to page:'+this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/save_page',{
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
},
|
||||
savePage() {
|
||||
console.log('Saving to page:'+this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/save_page',{
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
}, {
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
formData.append('image',selectedFile);
|
||||
formData.append('folder',selectedFolder);
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/auth/upload',formData,{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/upload',formData,{
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -173,7 +173,7 @@
|
|||
|
||||
const formData = new FormData();
|
||||
formData.append("folder", folderName);
|
||||
axios.post('http://localhost:8000/api/v1/auth/create_folder',formData,{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/create_folder',formData,{
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
},
|
||||
loadFoldersWithImages() {
|
||||
console.log("Requesting folders with images");
|
||||
axios.post('http://localhost:8000/api/v1/auth/get_folders_with_images',{},{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/get_folders_with_images',{},{
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
console.log("logging out with token "+this.$store.state.user_token);
|
||||
|
||||
// Empty brackets are an empty object usually containing form data
|
||||
axios.post('http://localhost:8000/api/v1/auth/logout',{}, {
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/logout',{}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
this.$store.state.page_name=page_name;
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/load_page',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/load_page',{
|
||||
page: page_name
|
||||
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@
|
|||
},
|
||||
savePage() {
|
||||
console.log('Saving to page:'+this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/save_page',{
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
}, {
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
formData.append('image',selectedFile);
|
||||
formData.append('folder',selectedFolder);
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/auth/upload',formData,{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/upload',formData,{
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -173,7 +173,7 @@
|
|||
|
||||
const formData = new FormData();
|
||||
formData.append("folder", folderName);
|
||||
axios.post('http://localhost:8000/api/v1/auth/create_folder',formData,{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/create_folder',formData,{
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token,
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
},
|
||||
loadFolders() {
|
||||
console.log("Requesting folders");
|
||||
axios.post('http://localhost:8000/api/v1/auth/get_folders',{},{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/get_folders',{},{
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
console.log("logging out with token "+this.$store.state.user_token);
|
||||
|
||||
// Empty brackets are an empty object usually containing form data
|
||||
axios.post('http://localhost:8000/api/v1/auth/logout',{}, {
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/logout',{}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
this.$store.state.page_name=page_name;
|
||||
|
||||
axios.post('http://localhost:8000/api/v1/load_page',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/load_page',{
|
||||
page: page_name
|
||||
|
||||
}, {
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
},
|
||||
loadUserList() {
|
||||
// Empty brackets are an empty object usually containing form data
|
||||
axios.post('http://localhost:8000/api/v1/auth/get_userlist', {}, {
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/get_userlist', {}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
console.log("Setting new role for userid "+user_id+": "+role);
|
||||
|
||||
// Empty brackets are an empty object usually containing form data
|
||||
axios.post('http://localhost:8000/api/v1/auth/set_role',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/set_role',{
|
||||
user_id:user_id,
|
||||
role:role
|
||||
}, {
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
console.log("Deleting userid "+user_id);
|
||||
|
||||
// Empty brackets are an empty object usually containing form data
|
||||
axios.post('http://localhost:8000/api/v1/auth/delete_user',{
|
||||
axios.post(this.$store.state.app_url+'/api/v1/auth/delete_user',{
|
||||
user_id:user_id
|
||||
}, {
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue