feat(share): reuse existing share and direct links per file
This commit is contained in:
@@ -2497,12 +2497,18 @@ handleDragLeave(e) {
|
||||
if (response.data.success) {
|
||||
const itemType = this.shareFileForm.isDirectory ? '文件夹' : '文件';
|
||||
this.shareResult = this.buildShareResult(response.data, {
|
||||
hasPassword: this.shareFileForm.enablePassword,
|
||||
hasPassword: !!response.data.has_password,
|
||||
targetName: this.shareFileForm.fileName,
|
||||
targetType: shareType,
|
||||
password
|
||||
password: response.data.reused ? '' : password
|
||||
});
|
||||
this.showToast('success', '成功', this.shareFileForm.enablePassword ? `${itemType}加密分享已创建` : `${itemType}分享链接已创建`);
|
||||
this.showToast(
|
||||
'success',
|
||||
'成功',
|
||||
response.data.reused
|
||||
? `${itemType}已复用现有分享链接`
|
||||
: (this.shareFileForm.enablePassword ? `${itemType}加密分享已创建` : `${itemType}分享链接已创建`)
|
||||
);
|
||||
this.loadShares();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -2551,7 +2557,7 @@ handleDragLeave(e) {
|
||||
...response.data,
|
||||
target_name: this.directLinkForm.fileName
|
||||
};
|
||||
this.showToast('success', '成功', '直链已创建');
|
||||
this.showToast('success', '成功', response.data.reused ? '已复用现有直链' : '直链已创建');
|
||||
this.loadDirectLinks();
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user