fix: 创建分享时检测是否含有子分享
This commit is contained in:
parent
7c562f4a66
commit
e7c8fa63d9
@ -237,7 +237,7 @@ export default {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 检测是否含有子分享
|
// 检测分享文件下是否含有子分享
|
||||||
hasSubShare: function(params) {
|
hasSubShare: function(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/share/has-sub-share',
|
url: '/share/has-sub-share',
|
||||||
@ -248,6 +248,14 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 检测文件下是否含有子分享
|
||||||
|
folderSubShare: function(params) {
|
||||||
|
return request({
|
||||||
|
url: '/share/folder-sub-share',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
},
|
||||||
// 取消分享
|
// 取消分享
|
||||||
cancelShareLink: function(params) {
|
cancelShareLink: function(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -343,7 +343,7 @@ export default {
|
|||||||
|
|
||||||
api.hasSubShare({shareIds: [this.shareId]}).then(res => {
|
api.hasSubShare({shareIds: [this.shareId]}).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.$confirm('选择的文件夹下存其他分享,取消分享后其下的所有分享链接都将被删除,是否继续?', '提示', {
|
this.$confirm('所选的文件夹下存其他分享,取消分享后其下的所有分享链接都将被删除,是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@ -425,7 +425,30 @@ export default {
|
|||||||
this.generateShareLinkLoading = false
|
this.generateShareLinkLoading = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 检查文件夹下是否有其他分享
|
||||||
|
if (this.file.isFolder) {
|
||||||
|
api.folderSubShare({fileId: this.file.id}).then(res => {
|
||||||
|
if (res.data) {
|
||||||
|
this.$confirm('所选的文件夹下存其他分享,创建分享后将会覆盖其下所有已分享的链接参数,是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.doCreateShare(update, expireDate)
|
||||||
|
}).catch(() => {
|
||||||
|
this.generateShareLinkLoading = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.doCreateShare(update, expireDate)
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.generateShareLinkLoading = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.doCreateShare(update, expireDate)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doCreateShare(update, expireDate) {
|
||||||
api.generate({
|
api.generate({
|
||||||
shortId: this.shareOption.customAddr,
|
shortId: this.shareOption.customAddr,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
|
|||||||
@ -79,6 +79,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="table-file-name">{{ scope.row.fileName }}</span>
|
<span class="table-file-name">{{ scope.row.fileName }}</span>
|
||||||
|
<span v-if="scope.row.fatherShareId" style="color: #9a9a9a">(子分享)</span>
|
||||||
</template>
|
</template>
|
||||||
</pl-table-column>
|
</pl-table-column>
|
||||||
<!--取消分享-->
|
<!--取消分享-->
|
||||||
@ -460,7 +461,7 @@
|
|||||||
|
|
||||||
api.hasSubShare({shareIds: shareIds}).then(res => {
|
api.hasSubShare({shareIds: shareIds}).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.$confirm('选择的文件夹下存其他分享,取消分享后其下的所有分享链接都将被删除,是否继续?', '提示', {
|
this.$confirm('所选的文件夹下存其他分享,取消分享后其下的所有分享链接都将被删除,是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user