public async Task <IActionResult> BucketExists()
        {
            try
            {
                bool result = await _OSSService.BucketExistsAsync(_bucketName);

                return(Content(result.ToString()));
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
Beispiel #2
0
        public async Task <IActionResult> BucketExists()
        {
            try
            {
                bool result = await _ossService.BucketExistsAsync(_bucketName);

                return(Json(new ResultObject()
                {
                    Status = result,
                    Message = result ? $"{_bucketName}已存在" : $"{_bucketName}不存在"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new ResultObject()
                {
                    Status = false,
                    Message = ex.Message
                }));
            }
        }