mirror of
https://gitee.com/zhangsken/aliyunpan.git
synced 2026-10-16 02:23:49 +08:00
add sample code for js plugin
This commit is contained in:
@@ -127,16 +127,16 @@ function downloadFilePrepareCallback(context, params) {
|
||||
function downloadFileFinishCallback(context, params) {
|
||||
console.log(params)
|
||||
|
||||
// 云盘文件成功下载到本地后,删除云盘的文件
|
||||
if (params["downloadResult"] == "success") {
|
||||
if (params["driveFileType"] == "file") {
|
||||
// 文件下载成功,删除该云盘文件
|
||||
var userId = context["userId"]
|
||||
var driveId = params["driveId"]
|
||||
var driveFileId = params["driveFileId"]
|
||||
if (PluginUtil.PanFS.deleteFile(userId, driveId, driveFileId)) {
|
||||
console.log("插件删除云盘文件成功:" + params["driveFilePath"])
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 云盘文件成功下载到本地后,删除云盘的文件
|
||||
// if (params["downloadResult"] == "success") {
|
||||
// if (params["driveFileType"] == "file") {
|
||||
// // 文件下载成功,删除该云盘文件
|
||||
// var userId = context["userId"]
|
||||
// var driveId = params["driveId"]
|
||||
// var driveFileId = params["driveFileId"]
|
||||
// if (PluginUtil.PanFS.deleteFile(userId, driveId, driveFileId)) {
|
||||
// console.log("插件删除云盘文件成功:" + params["driveFilePath"])
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -202,6 +202,18 @@ function syncScanPanFilePrepareCallback(context, params) {
|
||||
// ------------------------------------------------------------------------------------------
|
||||
function syncFileFinishCallback(context, params) {
|
||||
console.log(params)
|
||||
// 云盘文件成功下载到本地后,删除云盘的文件
|
||||
// if (params["action"] == "download") {
|
||||
// if (params["actionResult"] == "success" && params["fileType"] == "file") {
|
||||
// // 文件下载成功,删除该云盘文件
|
||||
// var userId = context["userId"]
|
||||
// var driveId = params["driveId"]
|
||||
// var driveFileId = params["driveFileId"]
|
||||
// if (PluginUtil.PanFS.deleteFile(userId, driveId, driveFileId)) {
|
||||
// console.println("插件删除云盘文件成功:" + params["filePath"])
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -84,8 +84,8 @@ func DeletePanFile(userId, driveId, panFileId string) bool {
|
||||
return false
|
||||
} else {
|
||||
logger.Verboseln("[Plugin] delete pan file success: ", panFileId)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SendTextMail 发送文本邮件
|
||||
|
||||
Reference in New Issue
Block a user