SVN-Revision: r557
This commit is contained in:
wyf
2025-05-08 09:01:05 +00:00
parent 6023b8eba4
commit 17889d7e90
+49
View File
@@ -101,5 +101,54 @@ namespace Lskj.Util
}
}
else
{
returnMsg = "登录失败";
isUpload = false;
}
return isUpload;
}
/// <summary>
/// 上传文件
/// </summary>
/// <param name="token"></param>
/// <param name="url"></param>
/// <param name="fileStream"></param>
/// <param name="fileId"></param>
/// <param name="returnMsg"></param>
/// <returns></returns>
public static bool DeleteFile(string token, string url, out string returnMsg)
{
bool isDelete = false;
returnMsg = "";
if (!string.IsNullOrEmpty(token))
{
HttpHelper.Setting("application/x-www-form-urlencoded", null, null);
Dictionary<string, string> headerDic = new Dictionary<string, string>();
headerDic.Add("Authorization", $"Bearer {token}");
HttpWebResponse webResponse = HttpHelper.Post(url, "", null, headerDic, out string result);
if (webResponse != null && !string.IsNullOrEmpty(result))
{
JObject jsonObject = (JObject)JsonConvert.DeserializeObject(result);
string isSuccess = jsonObject["success"] + "";
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
{
isDelete = true;
}
else
{
if (jsonObject.ContainsKey("msg"))
{
returnMsg = jsonObject["msg"] + "";
}
isDelete = false;
}
}
else
{
returnMsg = "删除请求失败";
isDelete = false;
}
}
else
{
returnMsg