mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
share routes refactoring
This commit is contained in:
@@ -106,7 +106,7 @@ export default {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${this.$router.currentRoute.params.token}/upload/remote`,
|
||||
Public: `/api/editor/upload/remote/${this.$router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/upload/remote/${this.$router.currentRoute.params.token}`,
|
||||
}[this.$router.currentRoute.name] || '/api/upload/remote'
|
||||
|
||||
let parentId = this.$store.getters.currentFolder
|
||||
|
||||
@@ -890,7 +890,7 @@ export default {
|
||||
|
||||
// Get route
|
||||
let route = this.$store.getters.sharedDetail
|
||||
? `/api/search/${this.$router.currentRoute.params.token}`
|
||||
? `/api/sharing/search/${this.$router.currentRoute.params.token}`
|
||||
: '/api/search'
|
||||
|
||||
axios
|
||||
|
||||
2
resources/js/store/modules/fileBrowser.js
vendored
2
resources/js/store/modules/fileBrowser.js
vendored
@@ -105,7 +105,7 @@ const actions = {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/navigation`,
|
||||
Public: `/api/browse/navigation/${router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/navigation/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/browse/navigation'
|
||||
|
||||
axios
|
||||
|
||||
14
resources/js/store/modules/fileFunctions.js
vendored
14
resources/js/store/modules/fileFunctions.js
vendored
@@ -34,7 +34,7 @@ const actions = {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail
|
||||
? `/api/zip/${router.currentRoute.params.token}?items=${files.join(',')}`
|
||||
? `/api/sharing/zip/${router.currentRoute.params.token}?items=${files.join(',')}`
|
||||
: `/api/zip?items=${files.join(',')}`
|
||||
|
||||
// Download zip
|
||||
@@ -60,14 +60,14 @@ const actions = {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/move`,
|
||||
Public: `/api/editor/move/${router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/move/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/move'
|
||||
|
||||
let moveToId = to_item.data ? to_item.data.id : to_item.id
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
to_id: moveToId || null,
|
||||
to_id: moveToId || undefined,
|
||||
items: itemsToMove,
|
||||
})
|
||||
.then(() => {
|
||||
@@ -88,7 +88,7 @@ const actions = {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/create-folder`,
|
||||
Public: `/api/editor/create-folder/${router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/create-folder/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/create-folder'
|
||||
|
||||
axios
|
||||
@@ -127,7 +127,7 @@ const actions = {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/rename/${data.id}`,
|
||||
Public: `/api/editor/rename/${data.id}/${router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/rename/${data.id}/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || `/api/rename/${data.id}`
|
||||
|
||||
axios
|
||||
@@ -150,7 +150,7 @@ const actions = {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/upload/chunks`,
|
||||
Public: `/api/editor/upload/chunks/${router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/upload/chunks/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/upload/chunks'
|
||||
|
||||
// Create cancel token for axios cancellation
|
||||
@@ -320,7 +320,7 @@ const actions = {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/remove`,
|
||||
Public: `/api/editor/remove/${router.currentRoute.params.token}`,
|
||||
Public: `/api/sharing/remove/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/remove'
|
||||
|
||||
axios
|
||||
|
||||
4
resources/js/store/modules/sharing.js
vendored
4
resources/js/store/modules/sharing.js
vendored
@@ -25,7 +25,7 @@ const actions = {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(`/api/browse/folders/${id}/${router.currentRoute.params.token}${getters.sorting.URI}`)
|
||||
.get(`/api/sharing/folders/${id}/${router.currentRoute.params.token}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
@@ -50,7 +50,7 @@ const actions = {
|
||||
getShareDetail: ({ commit, state }, token) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(`/api/browse/share/${token}`)
|
||||
.get(`/api/sharing/share/${token}`)
|
||||
.then((response) => {
|
||||
resolve(response)
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ export default {
|
||||
|
||||
// Send request to get verify account
|
||||
axios
|
||||
.post('/api/browse/authenticate/' + this.$route.params.token, {
|
||||
.post('/api/sharing/authenticate/' + this.$route.params.token, {
|
||||
password: this.password,
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
axios
|
||||
.get(`/api/browse/file/${this.$router.currentRoute.params.token}`)
|
||||
.get(`/api/sharing/file/${this.$router.currentRoute.params.token}`)
|
||||
.then((response) => {
|
||||
this.file = response.data
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user