public async Task <IActionResult> RemoveObject()
        {
            try
            {
                var result = await _OSSService.RemoveObjectAsync(_bucketName, "PHOTO-1.jpg");

                return(Content(result.ToString()));
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> RemoveObject()
        {
            try
            {
                var result = await _ossService.RemoveObjectAsync(_bucketName, _objectFilePath);

                return(Json(new ResultObject()
                {
                    Status = result,
                    Message = !result ? $"删除文件/文件夹【{_objectFilePath}】失败" : $"删除文件/文件夹【{_objectFilePath}】成功"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new ResultObject()
                {
                    Status = false,
                    Message = ex.Message
                }));
            }
        }